PaginatedGridView<T, S extends PaginatedState<T>> constructor

const PaginatedGridView<T, S extends PaginatedState<T>>({
  1. Key? key,
  2. required ProviderListenable<S> provider,
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. T item,
    3. int index
    ),
  4. required Future<void> onLoad(),
  5. required Future<void> onLoadMore(
    1. String nextPageToken
    ),
  6. required Future<void> onRefresh(),
  7. required SliverGridDelegate gridDelegate,
  8. Widget? loadingWidget,
  9. Widget errorWidget(
    1. String error,
    2. VoidCallback retry
    )?,
  10. Widget? emptyWidget,
  11. double scrollThreshold = 0.8,
  12. EdgeInsetsGeometry padding = const EdgeInsets.all(12),
  13. List<Widget> topWidgets = const [],
  14. List<Widget> bottomWidgets = const [],
  15. Widget? loadingMoreWidget,
  16. bool showLoadingMoreIndicator = true,
  17. ScrollController? scrollController,
  18. ScrollPhysics? physics,
  19. bool reverse = false,
  20. bool shrinkWrap = false,
  21. Key? refreshIndicatorKey,
  22. double crossAxisSpacing = 0.0,
  23. double mainAxisSpacing = 0.0,
})

Implementation

const PaginatedGridView({
  super.key,
  required this.provider,
  required this.itemBuilder,
  required this.onLoad,
  required this.onLoadMore,
  required this.onRefresh,
  required this.gridDelegate,
  this.loadingWidget,
  this.errorWidget,
  this.emptyWidget,
  this.scrollThreshold = 0.8,
  this.padding = const EdgeInsets.all(12),
  this.topWidgets = const [],
  this.bottomWidgets = const [],
  this.loadingMoreWidget,
  this.showLoadingMoreIndicator = true,
  this.scrollController,
  this.physics,
  this.reverse = false,
  this.shrinkWrap = false,
  this.refreshIndicatorKey,
  this.crossAxisSpacing = 0.0,
  this.mainAxisSpacing = 0.0,
});