ColumnBox constructor
const
ColumnBox({
- 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 vertical flex layout container.
All parameters are the same as FlexBox except direction which is automatically set to FlexDirection.column. Use this widget when you want children to flow vertically.
The reverse
parameter controls the flow direction:
false
(default): Items flow top to bottomtrue
: Items flow bottom to top
Example
ColumnBox(
wrap: FlexWrap.wrap,
alignItems: BoxAlignmentGeometry.stretch,
padding: EdgeSpacing.all(SpacingUnit.fixed(16)),
children: [
FlexItem(height: SizeUnit.fixed(50), child: Text('Fixed Height')),
FlexItem(flexGrow: 1, child: Text('Flexible')),
],
)
Reverse Example
ColumnBox(
reverse: true,
justifyContent: BoxAlignmentBase.end,
children: [/* items in reverse order */],
)
Implementation
const ColumnBox({
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.columnReverse
: FlexDirection.column,
);