SliverGridGeometry class
Describes the placement of a child in a RenderSliverGrid.
This class is similar to Rect, in that it gives a two-dimensional position and a two-dimensional dimension, but is direction-agnostic.
This example shows how a custom SliverGridLayout uses SliverGridGeometry
to lay out the children.
link
To create a local project with this code sample, run:
flutter create --sample=rendering.SliverGridGeometry.1 mysample
See also:
- SliverGridLayout, which represents the geometry of all the tiles in a grid.
- SliverGridLayout.getGeometryForChildIndex, which returns this object to describe the child's placement.
- RenderSliverGrid, which uses this class during its RenderSliverGrid.performLayout method.
- Annotations
Constructors
- SliverGridGeometry({required double scrollOffset, required double crossAxisOffset, required double mainAxisExtent, required double crossAxisExtent})
-
Creates an object that describes the placement of a child in a RenderSliverGrid.
const
Properties
- crossAxisExtent → double
-
The extent of the child in the non-scrolling axis.
final
- crossAxisOffset → double
-
The offset of the child in the non-scrolling axis.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- mainAxisExtent → double
-
The extent of the child in the scrolling axis.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollOffset → double
-
The scroll offset of the leading edge of the child relative to the leading
edge of the parent.
final
- trailingScrollOffset → double
-
The scroll offset of the trailing edge of the child relative to the
leading edge of the parent.
no setter
Methods
-
getBoxConstraints(
SliverConstraints constraints) → BoxConstraints - Returns a tight BoxConstraints that forces the child to have the required size, given a SliverConstraints.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited