which class or widget to use a better responsive layout in the flutter?

Viewed 167

This class or widget is useful to create a responsive layout.

AspectRatio CustomSingleChildLayout, CustomMultiChildLayout, FittedBox, FractionallySizedBox, LayoutBuilder, MediaQuery, MediaQueryData, OrientationBuilder.

Which is to use the better responsive layout.

2 Answers

iDecode already told you that it all depends on what you need. here take a look at official documentation, https://flutter.dev/docs/development/ui/layout. And here is my advice

  • Use row when you need Horizontal layout
  • Use column when you need Vertical layout
  • Use singleChildScrollView when you need scrolling layout
  • Use either GridView or listView when you need repetitive view
  • Use Expanded, Flexible, Limitedbox, flexiblebox for adjusting the size of the widget

Mine favourite : Rows for Horizontal, Column for vertical, Scrollview for Extra data exist in the page or UI not fitted in the screen, ListView for TableView UI etc

For best fitting layout: IS Expanded, AspectRatio

Related