DirectAbsoluteItem constructor
- Key? key,
- int? paintOrder,
- SizeUnit? width,
- SizeUnit? height,
- SizeUnit? minWidth,
- SizeUnit? maxWidth,
- SizeUnit? minHeight,
- SizeUnit? maxHeight,
- PositionUnit? top,
- PositionUnit? left,
- PositionUnit? bottom,
- PositionUnit? right,
- double? aspectRatio,
- bool needLayoutBox = false,
- required Widget child,
Creates an absolutely positioned item with the specified properties.
The child
parameter is required and specifies the widget to be positioned.
All positioning and sizing properties are optional and provide fine-grained
control over how this item is placed within its parent container.
Example
AbsoluteItem(
top: PositionUnit.fixed(10),
left: PositionUnit.fixed(20),
width: SizeUnit.fixed(200),
height: SizeUnit.fixed(100),
paintOrder: 1,
child: Text('Absolutely positioned'),
)
Creates a DirectAbsoluteItem with the specified properties.
The child
parameter is required and specifies the widget to be positioned
absolutely within its parent container.
The paintOrder
parameter controls the painting order when items overlap.
Lower values are painted first.
The width
and height
parameters specify the explicit size of the item.
If null, the size is determined by content or positioning constraints.
The minWidth
, maxWidth
, minHeight
, maxHeight
parameters set size
constraints for the item.
The top
, left
, bottom
, right
parameters specify the position offsets
from the parent's edges.
The aspectRatio
parameter maintains the width/height ratio if specified.
The needLayoutBox
parameter determines if the child needs access to
layout box information.
Implementation
const DirectAbsoluteItem({
super.key,
this.paintOrder,
this.width,
this.height,
this.minWidth,
this.maxWidth,
this.minHeight,
this.maxHeight,
this.top,
this.left,
this.bottom,
this.right,
this.aspectRatio,
this.needLayoutBox = false,
required super.child,
});