SliverLayoutGrid.extentBuilder constructor
SliverLayoutGrid.extentBuilder({})
Creates a sliver that builds multiple box children in a two dimensional arrangement with cells that each have a maximum cross-axis extent.
This constructor is appropriate for grid views with a large (or infinite) number of children because the builder is called only for those children that are actually visible.
Uses a SliverLayoutGridDelegateWithMaxCrossAxisExtent as the
gridDelegate, and a SliverVariableSizeChildBuilderDelegate
as the delegate.
See also:
new LayoutGrid.extentBuilder
, the equivalent constructor for LayoutGrid widgets.
Implementation
SliverLayoutGrid.extentBuilder({
Key? key,
required double maxCrossAxisExtent,
required IndexedWidgetBuilder itemBuilder,
required int itemCount,
double mainAxisSpacing: 0.0,
double crossAxisSpacing: 0.0,
}) : gridDelegate = SliverLayoutGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: maxCrossAxisExtent,
mainAxisSpacing: mainAxisSpacing,
crossAxisSpacing: crossAxisSpacing,
),
delegate = SliverChildBuilderDelegate(
itemBuilder,
childCount: itemCount,
addAutomaticKeepAlives: false,
addRepaintBoundaries: false,
addSemanticIndexes: false,
),
super(
key: key,
);