RowBox constructor
const
RowBox({
- Key? key,
- FlexWrap wrap = FlexWrap.none,
- int? maxItemsPerLine,
- int? maxLines,
- EdgeSpacingGeometry padding = EdgeSpacing.zero,
- SpacingUnit rowGap = SpacingUnit.zero,
- SpacingUnit columnGap = SpacingUnit.zero,
- BoxAlignmentGeometry alignItems = BoxAlignmentGeometry.start,
- BoxAlignmentContent alignContent = BoxAlignmentContent.start,
- BoxAlignmentBase justifyContent = BoxAlignmentBase.start,
- TextDirection? textDirection,
- bool reversePaint = false,
- ScrollController? verticalController,
- ScrollController? horizontalController,
- DiagonalDragBehavior diagonalDragBehavior = DiagonalDragBehavior.free,
- LayoutOverflow horizontalOverflow = LayoutOverflow.hidden,
- LayoutOverflow verticalOverflow = LayoutOverflow.hidden,
- TextBaseline? textBaseline,
- Clip clipBehavior = Clip.hardEdge,
- BorderRadiusGeometry? borderRadius,
- List<
Widget> children = const [], - bool reverse = false,
Creates a horizontal flex layout container.
All parameters are the same as FlexBox except direction which is automatically set to FlexDirection.row. Use this widget when you want children to flow horizontally.
The reverse
parameter controls the flow direction:
false
(default): Items flow left to right (right to left in RTL)true
: Items flow right to left (left to right in RTL)
Example
RowBox(
wrap: FlexWrap.wrap,
alignItems: BoxAlignmentGeometry.center,
padding: EdgeSpacing.all(SpacingUnit.fixed(16)),
children: [
FlexItem(flexGrow: 1, child: Text('Flexible')),
FlexItem(width: SizeUnit.fixed(100), child: Text('Fixed')),
],
)
Reverse Example
RowBox(
reverse: true,
justifyContent: BoxAlignmentBase.end,
children: [/* items in reverse order */],
)
Implementation
const RowBox({
super.key,
super.wrap,
super.maxItemsPerLine,
super.maxLines,
super.padding,
super.rowGap,
super.columnGap,
super.alignItems,
super.alignContent,
super.justifyContent,
super.textDirection,
super.reversePaint,
super.verticalController,
super.horizontalController,
super.diagonalDragBehavior,
super.horizontalOverflow,
super.verticalOverflow,
super.textBaseline,
super.clipBehavior,
super.borderRadius,
super.children = const [],
bool reverse = false,
}) : super(direction: reverse ? FlexDirection.rowReverse : FlexDirection.row);