Skip to content

Align

Positions a single child within the available space according to alignment.

Learn more: Layout

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

Align(
alignment: Alignment.centerRight,
child: Text('status'),
)

Align takes the largest size its constraints allow, then lays the child out with loosened constraints (so the child can be smaller than the parent), then paints the child at the computed alignment offset. Cells around the child are left empty so any content beneath in a Stack shows through.

On each unbounded axis Align collapses to the child’s size, subject to the minimum constraint. Bounded axes still expand and align normally.

ParameterTypeDefaultDescription
alignment:AlignmentAlignment.centerWhere to place the child within the space this widget receives.
child:WidgetrequiredThe subtree to position within the available space.

Align is defined in packages/fleury/lib/src/widgets/align.dart.

Category: Layout · All widgets