Search
 
SCRIPT & CODE EXAMPLE
 

DART

Determine the Screen size using the MediaQuery class Flutter

class Home extends StatefulWidget 
  const Home({Key? key}) : super(key: key);
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Media Query"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              height: (MediaQuery.of(context).size.height / 2),
              width: (MediaQuery.of(context).size.width / 2),
              color: Colors.green,
              child: const Center(child: Text("Media Query Container")),
            )
          ],
        ),
      ),
    );
  }
}{
Comment

PREVIOUS NEXT
Code Example
Dart :: get the type of an object dart 
Dart :: flutter getx dialog 
Dart :: flutter showdialog barrierdismissible 
Dart :: Error: java.io.IOException: No such file or directory in android 11 
Dart :: dart loop 
Dart :: dart class 
Dart :: how to subtract he height of appbar in flutter 
Dart :: how to send sms in flutter 
Dart :: dart ASCII to string 
Dart :: concat array dart 
Dart :: flutter nimations 
Dart :: flutter crop captured image 
Dart :: flutter logo flutter 
Dart :: how to change color notification bar in flutter 
Dart :: dart string equals 
Dart :: ~/ vs / dart 
Dart :: flutter firebase get provider type 
Dart :: Add glow or shadow to flutter widget 
Dart :: toolbar image dart 
Dart :: android emulator black screen flutter 
Dart :: flutter compare two list 
Dart :: flutter list key value 
Dart :: dart list get by index 
Swift :: swiftui random color 
Swift :: swift convert dictionary to json 
Swift :: swift animate a label ishidden 
Swift :: swiftui delay 
Swift :: how to get the last element of an array in swift 
Swift :: Swift Properties 
Swift :: dark mode change immediately swift 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =