DirectFlexItem constructor

const DirectFlexItem({
  1. Key? key,
  2. int? paintOrder,
  3. SizeUnit? width,
  4. SizeUnit? height,
  5. SizeUnit? minWidth,
  6. SizeUnit? maxWidth,
  7. SizeUnit? minHeight,
  8. SizeUnit? maxHeight,
  9. double flexGrow = 0.0,
  10. double flexShrink = 0.0,
  11. double? aspectRatio,
  12. PositionUnit? top,
  13. PositionUnit? left,
  14. PositionUnit? bottom,
  15. PositionUnit? right,
  16. BoxAlignmentGeometry? alignSelf,
  17. bool needLayoutBox = false,
  18. required Widget child,
})

Creates a DirectFlexItem with the specified properties.

The child parameter is required and specifies the widget to be laid out within the flex container.

The paintOrder parameter controls the painting order relative to siblings. Lower values are painted first.

The width and height parameters specify the preferred size of the item. If null, the size is determined by content and flex properties.

The minWidth, maxWidth, minHeight, maxHeight parameters set size constraints for the item.

The flexGrow parameter controls how much this item grows relative to siblings when there is extra space. Default is 0.0.

The flexShrink parameter controls how much this item shrinks relative to siblings when there is insufficient space. Default is 0.0.

The aspectRatio parameter maintains the width/height ratio if specified.

The top, left, bottom, right parameters are for sticky positioning.

The alignSelf parameter overrides the parent's alignItems for this item.

The needLayoutBox parameter determines if the child needs layout box info.

Implementation

const DirectFlexItem({
  super.key,
  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,
  this.needLayoutBox = false,
  required super.child,
});