GridLayoutDelegate class

A MultiChildLayoutDelegate that positions grid cells in viewport space.

Cell geometry is resolved here, at layout time, from two scroll- independent inputs — columnSpans for the horizontal axis and rowHeight for the vertical one — rather than being precomputed into per-cell rects by the widget layer. That's what lets scrolling reposition every cell through relayoutmarkNeedsLayout alone, with no widget rebuild.

Inheritance

Constructors

GridLayoutDelegate({required List<CellLayoutId> cellIds, required Map<int, ColumnSpan> columnSpans, required double rowHeight, required ValueNotifier<double> vOffset, required Listenable relayout, ValueNotifier<double>? hOffset, double pinnedWidth = 0.0})

Properties

cellIds List<CellLayoutId>
The cells currently built, in child order.
final
columnSpans Map<int, ColumnSpan>
Horizontal placement per column index (content space).
final
hashCode int
The hash code for this object.
no setterinherited
hOffset ValueNotifier<double>?
Horizontal scroll offset notifier. Pass null for the pinned quadrant.
final
pinnedWidth double
Width of the pinned-column area; added to unpinned cells' x positions.
final
rowHeight double
Uniform row height, in logical pixels.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vOffset ValueNotifier<double>
Vertical scroll offset notifier.
final

Methods

getSize(BoxConstraints constraints) Size
Override this method to return the size of this object given the incoming constraints.
inherited
hasChild(Object childId) bool
True if a non-null LayoutChild was provided for the specified id.
inherited
layoutChild(Object childId, BoxConstraints constraints) Size
Ask the child to update its layout within the limits specified by the constraints parameter. The child's size is returned.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performLayout(Size size) → void
Override this method to lay out and position all children given this widget's size.
override
positionChild(Object childId, Offset offset) → void
Specify the child's origin relative to this origin.
inherited
shouldRelayout(covariant GridLayoutDelegate oldDelegate) bool
Override this method to return true when the children need to be laid out.
override
toString() String
Override this method to include additional information in the debugging data printed by debugDumpRenderTree and friends.
inherited

Operators

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

Static Methods

buildRelayout({ValueNotifier<double>? hOffset, required ValueNotifier<double> vOffset}) Listenable
Builds the merged relayout listenable for a quadrant.