AppendedSliverChildBuilderDelegate constructor
AppendedSliverChildBuilderDelegate({
- required IndexedWidgetBuilder builder,
- required int childCount,
- WidgetBuilder? appendixBuilder,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
- SemanticIndexCallback? semanticIndexCallback,
Implementation
AppendedSliverChildBuilderDelegate({
required IndexedWidgetBuilder builder,
required int childCount,
WidgetBuilder? appendixBuilder,
bool addAutomaticKeepAlives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
SemanticIndexCallback? semanticIndexCallback,
}) : super(
appendixBuilder == null
? builder
: (context, index) {
if (index == childCount) {
return appendixBuilder(context);
}
return builder(context, index);
},
childCount: appendixBuilder == null ? childCount : childCount + 1,
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
semanticIndexCallback: semanticIndexCallback ?? (_, index) => index,
);