A Responsive Mobile app Using MediaQuery
Making the app responsive is very important for every developer. Using MediaQuery you can make app responsive to every screen sizes.
First, you have to find out how you can find out yu device size -width as well as -height. Using this print statement, you can get your device size in your terminal.
Note:- if you don’t wanna use this method to find height and width, you can use default values
Create a file responsive.dart in lib folder put this code inside your file.
Final Step — Implementation & Example
Initialize this under the BuildContext above the
Note:- the device height and device width is mentioned above, you can pass it as variable
Example — Link
This is not perfect solution because a lot of factors we have to consider like LayoutBuilder and AspectRatio and OrientationBuilder and Constraints and also few things we need to take care of based on Platform.
But this is a most basic and fast way to make thing work. I hope it helps.
GithubRepo — Link