AppendedSliverChildBuilderDelegate constructor

AppendedSliverChildBuilderDelegate({
  1. required IndexedWidgetBuilder builder,
  2. required int childCount,
  3. WidgetBuilder? appendixBuilder,
  4. bool addAutomaticKeepAlives = true,
  5. bool addRepaintBoundaries = true,
  6. bool addSemanticIndexes = true,
  7. 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,
      );