LayoutBoxWidget constructor

const LayoutBoxWidget({
  1. Key? key,
  2. TextDirection? textDirection,
  3. bool reversePaint = false,
  4. LayoutOverflow horizontalOverflow = LayoutOverflow.visible,
  5. LayoutOverflow verticalOverflow = LayoutOverflow.visible,
  6. ScrollController? horizontalController,
  7. ScrollController? verticalController,
  8. DiagonalDragBehavior diagonalDragBehavior = DiagonalDragBehavior.free,
  9. Axis mainScrollDirection = Axis.vertical,
  10. TextBaseline? textBaseline,
  11. BorderRadiusGeometry? borderRadius,
  12. Clip clipBehavior = Clip.hardEdge,
  13. bool reverseHorizontalScroll = false,
  14. bool reverseVerticalScroll = false,
  15. required Layout layout,
  16. 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,
});