InfiniteScrollListView<T>.list constructor

InfiniteScrollListView<T>.list({
  1. Key? key,
  2. required Future<List<T>> fetchNext(
    1. int index,
    2. int crossAxisCount
    ),
  3. Future<List<T>> fetchPrev(
    1. int index,
    2. int crossAxisCount
    )?,
  4. required Widget itemBuilder(
    1. BuildContext context,
    2. T item,
    3. int index
    ),
  5. void onIndexChanged(
    1. int index,
    2. int crossAxisCount
    )?,
  6. Key? dataKey,
  7. ScrollPhysics? physics,
  8. Axis scrollDirection = Axis.vertical,
  9. bool? primary,
  10. int initialIndex()?,
  11. bool initialIndexNotFoundCallback(
    1. int index,
    2. bool giveup
    )?,
  12. ScrollController? controller,
  13. Clip clipBehavior = Clip.hardEdge,
  14. double? cacheExtent,
  15. List<Widget>? overlaySlivers,
  16. EdgeInsets? padding,
  17. bool canRefresh = true,
  18. Widget refreshIndicatorBuilder(
    1. BuildContext context,
    2. Widget child,
    3. Future<void> refresh()
    )?,
  19. Widget? prefix,
  20. Widget? suffix,
  21. Widget? empty,
  22. Widget? loading,
  23. Widget? loadingMore,
  24. Widget errorBuilder(
    1. BuildContext context,
    2. Object error
    )?,
  25. void onRefresh()?,
  26. bool canFetchNext(
    1. int index
    )?,
  27. bool canFetchPrev(
    1. int index
    )?,
})

Creates an infinite scrolling list view.

Implementation

InfiniteScrollListView.list({
  super.key,
  required this.fetchNext,
  this.fetchPrev,
  required this.itemBuilder,
  this.onIndexChanged,
  this.dataKey,
  this.physics,
  this.scrollDirection = Axis.vertical,
  this.primary,
  this.initialIndex,
  this.initialIndexNotFoundCallback,
  this.controller,
  this.clipBehavior = Clip.hardEdge,
  this.cacheExtent,
  this.overlaySlivers,
  this.padding,
  this.canRefresh = true,
  this.refreshIndicatorBuilder,
  this.prefix,
  this.suffix,
  this.empty,
  this.loading,
  this.loadingMore,
  this.errorBuilder,
  this.onRefresh,
  this.canFetchNext,
  this.canFetchPrev,
})  : gridDelegate = null,
      _listBuilder = ((context, itemBuilder, count) => SliverList(
            delegate: SliverChildBuilderDelegate(
              childCount: count,
              itemBuilder,
            ),
          ));