SliverLayoutGridDelegateWithMaxCrossAxisExtent class

Create grid layouts with cells that each have a maximum cross-axis extent.

This delegate will select a cross-axis extent for the cells that is as large as possible subject to the following conditions:

  • The extent evenly divides the cross-axis extent of the grid.
  • The extent is at most maxCrossAxisExtent.

For example, if the grid is vertical, the grid is 500.0 pixels wide, and maxCrossAxisExtent is 150.0, this delegate will create a grid with 4 columns that are 125.0 pixels wide.

This delegate creates grids with variable sized but equally spaced cells.

See also:

Inheritance

Constructors

SliverLayoutGridDelegateWithMaxCrossAxisExtent({required double maxCrossAxisExtent, double mainAxisSpacing = 0.0, double crossAxisSpacing = 0.0, bool masonry = false})
Creates a delegate that makes grid layouts with cells that have a maximum cross-axis extent.
const

Properties

crossAxisSpacing double
The number of logical pixels between each child along the cross axis.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
mainAxisSpacing double
The number of logical pixels between each child along the main axis.
finalinherited
masonry bool
final
maxCrossAxisExtent double
The maximum extent of cells in the cross axis.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getConfiguration(SliverConstraints constraints) → LayoutGridConfiguration
Returns information about the layout grid configuration.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRelayout(covariant SliverLayoutGridDelegateWithMaxCrossAxisExtent oldDelegate) bool
Override this method to return true when the children need to be laid out.
override
toString() String
A string representation of this object.
inherited

Operators

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