LayoutEngine class abstract final

A standalone set of layout algorithms, operating on LayoutItem items.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

box({required Iterable<LayoutItem> items, required LayoutConstraints constraints, required double? targetWidth, required double? targetHeight, required EdgeInsets padding, required Anchor? alignment}) Vector2
Sizes a region to targetWidth/targetHeight - or to its largest item plus padding where either is null - then places every item inside it at alignment.
crossAxisOffset(CrossAxisAlignment alignment, double freeSpace) double
The cross-axis offset for freeSpace, per alignment.
distributeSpace(MainAxisAlignment alignment, double freeSpace, int count) → (double, double)
The leading gap and the gap between each pair of adjacent items, for freeSpace distributed across count items per alignment.
flex({required Axis direction, required LayoutConstraints constraints, required Iterable<LayoutItem> items, required MainAxisAlignment mainAxisAlignment, required CrossAxisAlignment crossAxisAlignment, required MainAxisSize mainAxisSize, required double spacing}) Vector2
Measures non-flex items, distributes remaining main-axis space to flex items, then positions everyone in exactly three passes.
place(LayoutItem item, Vector2 position) → void
Positions item so its content's top-left corner lands at position, honoring item's own anchor and scale.