DirectAbsoluteItem constructor

const DirectAbsoluteItem({
  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. PositionUnit? top,
  10. PositionUnit? left,
  11. PositionUnit? bottom,
  12. PositionUnit? right,
  13. double? aspectRatio,
  14. bool needLayoutBox = false,
  15. 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,
});