Complete the code to get the screen width using MediaQuery.
double screenWidth = MediaQuery.of(context).[1].width;The size property of MediaQueryData gives the screen size, including width and height.
Complete the code to check if the device is in landscape mode using MediaQuery.
bool isLandscape = MediaQuery.of(context).orientation == [1].landscape;The Orientation enum has values portrait and landscape to compare with MediaQuery orientation.
Fix the error in the code to get the height excluding padding (like status bar) using MediaQuery.
double height = MediaQuery.of(context).size.height - MediaQuery.of(context).[1].top;The padding property gives the parts of the screen obscured by system UI like status bar.
Fill both blanks to create a Container that is half the screen width and a quarter of the screen height.
Container(width: MediaQuery.of(context).size.[1] / 2, height: MediaQuery.of(context).size.[2] / 4, color: Colors.blue);
The width and height properties of MediaQuery size give screen dimensions to calculate container size.
Fill all three blanks to create a Text widget that shows screen width, height, and orientation.
Text('Width: ${MediaQuery.of(context).size.[1], Height: ${MediaQuery.of(context).size.[2], Orientation: ${MediaQuery.of(context).[3]');
This code shows screen width and height from size, and orientation from MediaQuery directly.