Flutter responsive landscape view
i just started to develop a small Flutter application and came a long the following problem:
How can i make sure the view is fitting in every device and is not overflowing?
Do i have to work with
everywhere and calculate everything..?
And another problem for me are the buttons shown in the sketch. They have diffrent texts and thus they aren't the same width. I tried to put both of them into a container and give the container a width and let the buttons expand. But here again, i am struggling with the diffrent sizes of the devices. If i give a width of 300 to both of the buttons, wouldn't that be to much for a smaller device and they would overflow?
Sadly i need to emulate on my phone and can't try diffrent resolutions.
I appreciate any kind of help.
Create a dart file 'ScreenVariables.dart'
Inside this dart file, create a class sv
Inside this class, create a static var:
static double dblScreenWidth = window.physicalSize.width / window.devicepixelratio;
Create other static vars in class sv such as dblScreenHeight, dblDefaultFontSize = dblScreenWidth / 20, dblDefaultButtonWidth = dblScreenWidth / 5
Import this dart file in all other dart files.
Then you can set the Width of your buttons to sv.dblDefaultButtonWidth in other dart files.