PaginatedGridView<T, S extends PaginatedState<T> > constructor
const
PaginatedGridView<T, S extends PaginatedState<T> > ({
- Key? key,
- required ProviderListenable<
S> provider, - required Widget itemBuilder(
- BuildContext context,
- T item,
- int index
- required Future<
void> onLoad(), - required Future<
void> onLoadMore(- String nextPageToken
- required Future<
void> onRefresh(), - required SliverGridDelegate gridDelegate,
- Widget? loadingWidget,
- Widget errorWidget(
- String error,
- VoidCallback retry
- Widget? emptyWidget,
- double scrollThreshold = 0.8,
- EdgeInsetsGeometry padding = const EdgeInsets.all(12),
- List<
Widget> topWidgets = const [], - List<
Widget> bottomWidgets = const [], - Widget? loadingMoreWidget,
- bool showLoadingMoreIndicator = true,
- ScrollController? scrollController,
- ScrollPhysics? physics,
- bool reverse = false,
- bool shrinkWrap = false,
- Key? refreshIndicatorKey,
- double crossAxisSpacing = 0.0,
- 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,
});