GridLayoutDelegate class

A MultiChildLayoutDelegate that positions grid cells in viewport space.

contentRects stores each cell's rect in content space (i.e. relative to the top-left of the full scrollable content, before any scroll offset is applied). performLayout reads the current scroll offsets directly from the ValueNotifiers and converts to viewport coordinates, so repositioning on scroll never requires a widget rebuild — only a markNeedsLayout call via the relayout listenable.

Inheritance

Constructors

GridLayoutDelegate({required Map<CellLayoutId, Rect> contentRects, required ValueNotifier<double> vOffset, ValueNotifier<double>? hOffset, double pinnedWidth = 0.0})

Properties

contentRects Map<CellLayoutId, Rect>
Cell positions in content space (scroll-independent).
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
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