<p>You can get the size of the screen in flutter using MediaQuery as below.</p> <p>Here is an example of how to use that in your program.</p> <p id="4ec9b0;](MyApp());" color:="" color:=>color: #9cdcfe;](args) </p> <p id="9cdcfe;](key" color:= color:=>color: #569cd6;](class color: #4ec9b0;](MyApp color: #569cd6;](extends color: #4ec9b0;](StatelessWidget ); color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #c586c0;](return color: #569cd6;](const color: #4ec9b0;](MaterialApp( color: #9cdcfe;](home: color: #4ec9b0;](Scaffold( color: #9cdcfe;](body: color: #4ec9b0;](MyContainer(), ), ); } }</p> <p id="9cdcfe;](key," color:= color:="" color:=>color: #569cd6;](class color: #4ec9b0;](MyContainer color: #569cd6;](extends color: #4ec9b0;](StatelessWidget ); color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #569cd6;](var color: #9cdcfe;](screenSize = color: #4ec9b0;](MediaQuery.color: #dcdcaa;](of(color: #9cdcfe;](context).color: #9cdcfe;](size; color: #569cd6;](var color: #9cdcfe;](screenOrientation = color: #4ec9b0;](MediaQuery.color: #dcdcaa;](of(color: #9cdcfe;](context).color: #9cdcfe;](orientation;</p> <pre>color: #c586c0;](return color: #4ec9b0;](Center( color: #9cdcfe;](child: color: #4ec9b0;](Padding( color: #9cdcfe;](padding: color: #569cd6;](const color: #4ec9b0;](EdgeInsets.color: #dcdcaa;](symmetric(color: #9cdcfe;](vertical: color: #b5cea8;](100), color: #9cdcfe;](child: color: #4ec9b0;](Padding( color: #9cdcfe;](padding: color: #569cd6;](const color: #4ec9b0;](EdgeInsets.color: #dcdcaa;](all(color: #b5cea8;](28.0), color: #9cdcfe;](child: color: #4ec9b0;](Column( color: #9cdcfe;](crossAxisAlignment: color: #4ec9b0;](CrossAxisAlignment.color: #4fc1ff;](start, color: #9cdcfe;](children: [ color: #4ec9b0;](Text( color: #ce9178;]('ScreenSize - $color: #9cdcfe;](screenSize </pre> <p id="9cdcfe;](height" color:=>color: #ce9178;](', color: #9cdcfe;](style: color: #569cd6;](const color: #4ec9b0;](TextStyle(color: #9cdcfe;](fontSize: color: #b5cea8;](18.0), ), color: #569cd6;](const color: #4ec9b0;](SizedBox( color: #9cdcfe;](height: color: #b5cea8;](20, ), color: #4ec9b0;](Text( color: #ce9178;]('Screen Width - $color: #ce9178;](', color: #9cdcfe;](style: color: #569cd6;](const color: #4ec9b0;](TextStyle(color: #9cdcfe;](fontSize: color: #b5cea8;](18.0), ), color: #569cd6;](const color: #4ec9b0;](SizedBox( color: #9cdcfe;](height: color: #b5cea8;](20, ), color: #4ec9b0;](Text( color: #ce9178;]('Screen height - $color: #ce9178;](', color: #9cdcfe;](style: color: #569cd6;](const color: #4ec9b0;](TextStyle(color: #9cdcfe;](fontSize: color: #b5cea8;](18.0), ), color: #569cd6;](const color: #4ec9b0;](SizedBox( color: #9cdcfe;](height: color: #b5cea8;](20, ), color: #4ec9b0;](Text( color: #ce9178;]('Screen Orientation - $color: #9cdcfe;](screenOrientation color: #ce9178;](', color: #9cdcfe;](style: color: #569cd6;](const color: #4ec9b0;](TextStyle(color: #9cdcfe;](fontSize: color: #b5cea8;](18.0), ), ], ), ), ), ); } } ` Thanks,Srikanth</p>
How to get Screen size in flutter?
This Article is posted by seven.srikanth at 11/14/2022 4:31:20 PM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: Screensize in flutter
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter