BuilderFlexItem constructor

const BuilderFlexItem({
  1. Key? key,
  2. required Widget builder(
    1. BuildContext context,
    2. LayoutBox box
    ),
  3. int? paintOrder,
  4. SizeUnit? width,
  5. SizeUnit? height,
  6. SizeUnit? minWidth,
  7. SizeUnit? maxWidth,
  8. SizeUnit? minHeight,
  9. SizeUnit? maxHeight,
  10. double flexGrow = 0.0,
  11. double flexShrink = 0.0,
  12. double? aspectRatio,
  13. PositionUnit? top,
  14. PositionUnit? left,
  15. PositionUnit? bottom,
  16. PositionUnit? right,
  17. 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,
});