LayoutData constructor
LayoutData({
- LayoutBehavior behavior = LayoutBehavior.none,
- double flexGrow = 0.0,
- double flexShrink = 0.0,
- int? paintOrder,
- SizeUnit? width = SizeUnit.fitContent,
- SizeUnit? height = SizeUnit.fitContent,
- SizeUnit? minWidth,
- SizeUnit? maxWidth,
- SizeUnit? minHeight,
- SizeUnit? maxHeight,
- PositionUnit? top,
- PositionUnit? left,
- PositionUnit? right,
- PositionUnit? bottom,
- double? aspectRatio,
- 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,
});