Skip to content

Row

Lays out its children in a horizontal line.

See also: Column for a vertical line · Wrap to flow onto more lines.

Learn more: Layout

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

Row(
children: [
const Text('Name'),
const SizedBox(width: 2),
Expanded(child: TextInput(controller: name)),
],
)

Children take their natural width. Wrap one in Expanded to give it the width left over, or in Flexible to let it take up to a share of it; put a SizedBox(width: …) between children for a fixed gap. A row fills the available width unless mainAxisSize is MainAxisSize.min.

Children that don’t fit are clipped. With assertions enabled, the overflowing edge is marked so the mismatch is easy to spot.

ParameterTypeDefaultDescription
mainAxisSize:MainAxisSizeMainAxisSize.maxWhether this widget fills the free space on its main axis (MainAxisSize.max, the default) or shrinks to its children (MainAxisSize.min).
mainAxisAlignment:MainAxisAlignmentMainAxisAlignment.startHow the children are placed along the main axis when there is space left over.
crossAxisAlignment:CrossAxisAlignmentCrossAxisAlignment.startHow the children are placed across the main axis. CrossAxisAlignment.stretch makes them fill it.
children:List<Widget>const []The widgets below this widget in the tree, in layout and paint order.

Row is defined in packages/fleury/lib/src/widgets/basic.dart.

Category: Layout · All widgets