Syed Muhammad Oan
Syed Muhammad Oan

Reputation: 697

Does flutter take care of all screen sizes

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

  1. Do i have to take care of different screen sizes just like in android or does flutter handle that for me?

  2. Do i have to take care of API levels like android or does flutter take care of that? Thank you.

Upvotes: 2

Views: 4086

Answers (3)

Raouf Rahiche
Raouf Rahiche

Reputation: 31406

This is a late answer, but I hope it will help someone

  • In responsive UI we don’t use hard-coded values for dimension and positions.
  • Use MediaQuery to get the real time size of the window.
  • Use Flexible and Expanded widgets to get a flexible UI that works with percentage rather than hard coded values.
  • Use LayoutBuilder to get the ConstraintBox of the parent widget.
  • You can get the orientation of the device using MediaQuery or OrientationBuilder.

from this article

Upvotes: 5

satish
satish

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

Rémi Rousselet
Rémi Rousselet

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

Related Questions