InfiniteScrollListView<T>.grid constructor

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

Creates an infinite scrolling grid view.

Implementation

InfiniteScrollListView.grid({
  super.key,
  required this.fetchNext,
  this.fetchPrev,
  required this.itemBuilder,
  required this.gridDelegate,
  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,
}) : _listBuilder = ((context, itemBuilder, count) => SliverGrid(
            delegate: SliverChildBuilderDelegate(
              childCount: count,
              itemBuilder,
            ),
            gridDelegate: gridDelegate!,
          ));