Skip to content

Wrap

Flows children left-to-right, wrapping to a new row when the next one won’t fit the available width. The layout behind chips, tags, token lists, and reflowing toolbars.

Learn more: Layout

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

Wrap(
spacing: 1,
runSpacing: 1,
children: tags.map((tag) => Text('#$tag')).toList(),
)

spacing separates children within a row; runSpacing separates the rows. A child too wide for the line gets a row of its own.

ParameterTypeDefaultDescription
spacing:int0Gap between children within a row.
runSpacing:int0Gap between rows.
children:List<Widget>const <Widget>[]Widgets flowed into successive runs in declaration order.

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

Category: Layout · All widgets