SliverVariedExtentList.builder constructor
- Key? key,
- required NullableIndexedWidgetBuilder itemBuilder,
- required ItemExtentBuilder itemExtentBuilder,
- ChildIndexGetter? findChildIndexCallback,
- int? itemCount,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
A sliver that places multiple box children in a linear array along the main axis.
SliverVariedExtentList places its children in a linear array along the main
axis starting at offset zero and without gaps. Each child is forced to have
the returned extent of itemExtentBuilder
in the main axis and the
SliverConstraints.crossAxisExtent in the cross axis.
This constructor is appropriate for sliver lists with a large (or infinite) number of children whose extent is already determined.
Providing a non-null itemCount
improves the ability of the SliverVariedExtentList
to estimate the maximum scroll extent.
Implementation
SliverVariedExtentList.builder({
super.key,
required NullableIndexedWidgetBuilder itemBuilder,
required this.itemExtentBuilder,
ChildIndexGetter? findChildIndexCallback,
int? itemCount,
bool addAutomaticKeepAlives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
}) : super(delegate: SliverChildBuilderDelegate(
itemBuilder,
findChildIndexCallback: findChildIndexCallback,
childCount: itemCount,
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
));