GammaSmartPagination constructor
const
GammaSmartPagination({
- Key? key,
- required GammaController gammaSmartController,
- required ScrollController scrollController,
- required Widget child,
- required int itemCount,
- Future<
void> onRefresh()?, - Future<
void> onLoadMore()?, - Widget? header,
- Widget? noMoreDataWidget,
- Widget? loadingFailedWidget,
- Widget? refreshFailedWidget,
- Widget? noInitialDataWidget,
- Widget? loadingIndicator,
- double? scrollSensitivityTrigger,
- bool enableLogging = false,
Wrapper for scrollable widgets that enables pull to refresh and infinite scrolling pagination.
Typically used as wrapper for ListView, GridView.
Important: The child widget must must have physics set to NeverScrollableScrollPhysics and shrinkWrap set to true. because the GammaSmartPagination widget will handle the scrolling internally.
The optional parameters come with general default widgets, but you can override them with your own widgets.
Implementation
const GammaSmartPagination({
super.key,
required this.gammaSmartController,
required this.scrollController,
required this.child,
required this.itemCount,
this.onRefresh,
this.onLoadMore,
this.header,
this.noMoreDataWidget,
this.loadingFailedWidget,
this.refreshFailedWidget,
this.noInitialDataWidget,
this.loadingIndicator,
this.scrollSensitivityTrigger,
this.enableLogging = false,
});