JkAppBarListView.separated constructor

JkAppBarListView.separated({
  1. Key? key,
  2. bool keepAlive = true,
  3. Axis scrollDirection = Axis.vertical,
  4. bool reverse = false,
  5. ScrollController? controller,
  6. bool? primary,
  7. ScrollBehavior? scrollBehavior,
  8. bool shrinkWrap = false,
  9. Key? center,
  10. double anchor = 0.0,
  11. double? cacheExtent,
  12. int? semanticChildCount,
  13. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  14. ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  15. String? restorationId,
  16. Clip clipBehavior = Clip.hardEdge,
  17. required NullableIndexedWidgetBuilder itemBuilder,
  18. ChildIndexGetter? findChildIndexCallback,
  19. required IndexedWidgetBuilder separatorBuilder,
  20. required int itemCount,
  21. bool addAutomaticKeepAlives = true,
  22. bool addRepaintBoundaries = true,
  23. bool addSemanticIndexes = true,
})

Implementation

JkAppBarListView.separated({
  super.key,
  this.keepAlive = true,
  this.scrollDirection = Axis.vertical,
  this.reverse = false,
  this.controller,
  this.primary,
  this.scrollBehavior,
  this.shrinkWrap = false,
  this.center,
  this.anchor = 0.0,
  this.cacheExtent,
  this.semanticChildCount,
  this.dragStartBehavior = DragStartBehavior.start,
  this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
  this.restorationId,
  this.clipBehavior = Clip.hardEdge,
  required NullableIndexedWidgetBuilder itemBuilder,
  ChildIndexGetter? findChildIndexCallback,
  required IndexedWidgetBuilder separatorBuilder,
  required int itemCount,
  bool addAutomaticKeepAlives = true,
  bool addRepaintBoundaries = true,
  bool addSemanticIndexes = true,
})  : assert(itemCount >= 0),
      itemExtent = null,
      prototypeItem = null,
      childrenDelegate = SliverChildBuilderDelegate(
        (BuildContext context, int index) {
          final int itemIndex = index ~/ 2;
          if (index.isEven) {
            return itemBuilder(context, itemIndex);
          }
          return separatorBuilder(context, itemIndex);
        },
        findChildIndexCallback: findChildIndexCallback,
        childCount: _computeActualChildCount(itemCount),
        addAutomaticKeepAlives: addAutomaticKeepAlives,
        addRepaintBoundaries: addRepaintBoundaries,
        addSemanticIndexes: addSemanticIndexes,
        semanticIndexCallback: (Widget widget, int index) {
          return index.isEven ? index ~/ 2 : null;
        },
      );