Skip to content

Flexible

A widget that takes up to a flex share of the available main-axis space in a Flex. With FlexFit.loose the child can take less than its allocation; with FlexFit.tight it must take exactly that much.

See also: Expanded to make the child fill its share · Spacer for an empty gap.

Learn more: Layout

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

Row(children: [
Flexible(child: Text(longLabel)),
Text('ready'),
])
ParameterTypeDefaultDescription
flex:int1Share of remaining main-axis space relative to sibling flex children.
fit:FlexFitFlexFit.looseWhether the child must fill its allocation or may use less of it.
child:WidgetrequiredContent laid out within this widget’s flex allocation.

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

Category: Layout · All widgets