XCollectionView<T>.grid constructor

const XCollectionView<T>.grid({
  1. required XScrollItemBuilder<T> itemBuilder,
  2. required SliverGridDelegate? gridDelegate,
  3. Key? key,
  4. XScrollFetcher<T>? onInit,
  5. XScrollFetcher<T>? onLoadMore,
  6. ValueChanged<List<T>>? onItemsChanged,
  7. XScrollItemTap<T>? onItemTap,
  8. List<T> initialItems = const [],
  9. bool initialHasMore = true,
  10. int pageSize = 20,
  11. bool autoLoad = true,
  12. bool enableRefresh = true,
  13. Axis scrollDirection = Axis.vertical,
  14. double refreshTriggerExtent = 80,
  15. double paginationThreshold = 200,
  16. ScrollController? controller,
  17. EdgeInsetsGeometry? padding,
  18. ScrollPhysics? physics,
  19. Widget? header,
  20. Widget? footer,
  21. WidgetBuilder? loadingBuilder,
  22. WidgetBuilder? emptyBuilder,
  23. XScrollErrorBuilder? errorBuilder,
  24. WidgetBuilder? paginationLoadingBuilder,
  25. XScrollErrorBuilder? paginationErrorBuilder,
  26. XScrollRefreshIndicatorBuilder? refreshIndicatorBuilder,
  27. bool shrinkWrap = false,
  28. bool reverse = false,
  29. double? cacheExtent,
})

Creates a paginated grid collection.

Implementation

const XCollectionView.grid({
  required this.itemBuilder,
  required this.gridDelegate,
  super.key,
  this.onInit,
  this.onLoadMore,
  this.onItemsChanged,
  this.onItemTap,
  this.initialItems = const [],
  this.initialHasMore = true,
  this.pageSize = 20,
  this.autoLoad = true,
  this.enableRefresh = true,
  this.scrollDirection = Axis.vertical,
  this.refreshTriggerExtent = 80,
  this.paginationThreshold = 200,
  this.controller,
  this.padding,
  this.physics,
  this.header,
  this.footer,
  this.loadingBuilder,
  this.emptyBuilder,
  this.errorBuilder,
  this.paginationLoadingBuilder,
  this.paginationErrorBuilder,
  this.refreshIndicatorBuilder,
  this.shrinkWrap = false,
  this.reverse = false,
  this.cacheExtent,
}) : layout = XCollectionLayout.grid,
     separatorBuilder = null;