LayoutBoxWidget constructor
const
LayoutBoxWidget({
- Key? key,
- TextDirection? textDirection,
- bool reversePaint = false,
- LayoutOverflow horizontalOverflow = LayoutOverflow.visible,
- LayoutOverflow verticalOverflow = LayoutOverflow.visible,
- ScrollController? horizontalController,
- ScrollController? verticalController,
- DiagonalDragBehavior diagonalDragBehavior = DiagonalDragBehavior.free,
- Axis mainScrollDirection = Axis.vertical,
- TextBaseline? textBaseline,
- BorderRadiusGeometry? borderRadius,
- Clip clipBehavior = Clip.hardEdge,
- bool reverseHorizontalScroll = false,
- bool reverseVerticalScroll = false,
- required Layout layout,
- required List<
Widget> children,
Creates a layout container with the specified properties.
The layout
and children
parameters are required. The layout defines
how children are positioned, while children specifies the widgets to arrange.
Example
LayoutBoxWidget(
layout: FlexLayout(direction: FlexDirection.row),
horizontalOverflow: LayoutOverflow.scroll,
verticalOverflow: LayoutOverflow.hidden,
children: [Text('Child 1'), Text('Child 2')],
)
Most other parameters have sensible defaults and can be customized based on specific layout requirements.
Implementation
const LayoutBoxWidget({
super.key,
this.textDirection,
this.reversePaint = false,
this.horizontalOverflow = LayoutOverflow.visible,
this.verticalOverflow = LayoutOverflow.visible,
this.horizontalController,
this.verticalController,
this.diagonalDragBehavior = DiagonalDragBehavior.free,
this.mainScrollDirection = Axis.vertical,
this.textBaseline,
this.borderRadius,
this.clipBehavior = Clip.hardEdge,
this.reverseHorizontalScroll = false,
this.reverseVerticalScroll = false,
required this.layout,
required this.children,
});