Reputation: 697
I had an app idea and i want to develop it in either flutter or react native. I chose flutter because I want to learn a new language (Dart) and i know it's still in beta but I don't need to care about a lot of users for at-least 2-3 months since i am gonna learn dart first and then develop it. So my question is
Do i have to take care of different screen sizes just like in android or does flutter handle that for me?
Do i have to take care of API levels like android or does flutter take care of that? Thank you.
Upvotes: 2
Views: 4086
Reputation: 31406
This is a late answer, but I hope it will help someone
MediaQuery
to get the real time size of the window.Flexible
and Expanded
widgets to get a flexible UI that works
with percentage rather than hard coded values.LayoutBuilder
to get the ConstraintBox
of the parent widget.MediaQuery
or
OrientationBuilder
.from this article
Upvotes: 5
Reputation: 1374
Yes, you have to adjust the size of the UI according to screen size, you can use.
MediaQueryData media = MediaQuery.of(context);
var size = media.size;
this will give you screen size of the device.
Upvotes: 2
Reputation: 277657
Do i have to take care of different screen sizes just like in android or does flutter handle that for me?
Like Android, Flutter use DP as unit when sizing it's widgets. So pixel density has no effect. On the other hand, you still have to make your app "responsive".
Flutter provides a few widgets that help. Such as AspectRatio
.
Do i have to take care of API levels like android or does flutter take care of that? Thank you.
Usually, no. There's a plugin for quite a lot of the "low level api".
Sometimes you may need one that hasn't been implemented yet. And you'll need to create it yourself using Platform Channel
. You can find help here
Upvotes: 6