LayoutData constructor

const LayoutData({
  1. Object? key,
  2. PositionType position = PositionType.relative,
  3. LayoutBehavior behavior = LayoutBehavior.none,
  4. double flexGrow = 0.0,
  5. double flexShrink = 0.0,
  6. int? paintOrder,
  7. SizeUnit? width = SizeUnit.fitContent,
  8. SizeUnit? height = SizeUnit.fitContent,
  9. SizeUnit? minWidth,
  10. SizeUnit? maxWidth,
  11. SizeUnit? minHeight,
  12. SizeUnit? maxHeight,
  13. PositionUnit? top,
  14. PositionUnit? left,
  15. PositionUnit? right,
  16. PositionUnit? bottom,
  17. double? aspectRatio,
  18. BoxAlignmentGeometry? alignSelf,
})

Creates layout data with the specified properties.

Most parameters are optional and provide fine-grained control over layout behavior. The behavior, flexGrow, and flexShrink parameters are required as they have no sensible defaults.

Example

LayoutData(
  behavior: LayoutBehavior.none,
  flexGrow: 1.0,
  flexShrink: 0.0,
  width: SizeUnit.fixed(100),
  height: SizeUnit.fixed(50),
  alignSelf: BoxAlignmentGeometry.center,
)

Implementation

const LayoutData({
  this.key,
  this.position = PositionType.relative,
  this.behavior = LayoutBehavior.none,
  this.flexGrow = 0.0,
  this.flexShrink = 0.0,
  this.paintOrder,
  this.width = SizeUnit.fitContent,
  this.height = SizeUnit.fitContent,
  this.minWidth,
  this.maxWidth,
  this.minHeight,
  this.maxHeight,
  this.top,
  this.left,
  this.right,
  this.bottom,
  this.aspectRatio,
  this.alignSelf,
});