Layout
Rows, columns, lists and grids, laid out as Flutter lays them out.
Layout is Flutter's: constraints go down, sizes go up, and a parent places its children, as Flutter's Understanding constraints explains. So are the widgets:
Row,Column(both withspacing),Expanded,FlexibleandSpacer;Padding,SizedBox,ConstrainedBoxandAspectRatio;CenterandAlign;StackwithPositioned;Wrap;ListView(ListView::builderfor a long list),GridView,SingleChildScrollView,PageView, andCustomScrollViewwith slivers;LayoutBuilderandMediaQueryfor the room there is;Container,ColoredBox,DecoratedBoxandClipRRect.
let notes = ListView::builder(|_app, _context, i| Some(Text::new(format!("Note {i}")).into_widget()))
.item_count(100);
Column::new()
.cross_axis_alignment(CrossAxisAlignment::Stretch)
.children([
Padding::new(EdgeInsetsGeometry::all(12.0)).child(Text::new("Notes")).into_widget(),
Expanded::new(notes).into_widget(),
])A grid of tiles at most 160 points wide, with room around it:
GridView::extent(160.0)
.main_axis_spacing(8.0)
.cross_axis_spacing(8.0)
.children(tiles)
.build()
.padding(EdgeInsetsGeometry::all(16.0))
GridView::extentandGridView::counttake the tiles' settings;.build()answers theGridView, whosepaddingand scrolling settings follow it.