BuilderFlexItem constructor
const
BuilderFlexItem({
- Key? key,
- required Widget builder(
- BuildContext context,
- LayoutBox box
- int? paintOrder,
- SizeUnit? width,
- SizeUnit? height,
- SizeUnit? minWidth,
- SizeUnit? maxWidth,
- SizeUnit? minHeight,
- SizeUnit? maxHeight,
- double flexGrow = 0.0,
- double flexShrink = 0.0,
- double? aspectRatio,
- PositionUnit? top,
- PositionUnit? left,
- PositionUnit? bottom,
- PositionUnit? right,
- BoxAlignmentGeometry? alignSelf,
Creates a flex item with a builder function.
The builder
parameter is required and provides a function that constructs
the child widget dynamically. All flex and positioning properties are
optional and provide fine-grained control over how this item behaves
within the flex layout.
Example
BuilderFlexItem(
flexGrow: 1.0,
alignSelf: BoxAlignmentGeometry.center,
builder: (context, layoutBox) {
return Text('Size: ${layoutBox.size}');
},
)
Implementation
const BuilderFlexItem({
super.key,
required this.builder,
this.paintOrder,
this.width,
this.height,
this.minWidth,
this.maxWidth,
this.minHeight,
this.maxHeight,
this.flexGrow = 0.0,
this.flexShrink = 0.0,
this.aspectRatio,
this.top,
this.left,
this.bottom,
this.right,
this.alignSelf,
});