LayoutData constructor

LayoutData({
  1. LayoutBehavior behavior = LayoutBehavior.none,
  2. double flexGrow = 0.0,
  3. double flexShrink = 0.0,
  4. int? paintOrder,
  5. SizeUnit? width = SizeUnit.fitContent,
  6. SizeUnit? height = SizeUnit.fitContent,
  7. SizeUnit? minWidth,
  8. SizeUnit? maxWidth,
  9. SizeUnit? minHeight,
  10. SizeUnit? maxHeight,
  11. PositionUnit? top,
  12. PositionUnit? left,
  13. PositionUnit? right,
  14. PositionUnit? bottom,
  15. double? aspectRatio,
  16. 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

LayoutData({
  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,
});