GammaSmartPagination constructor

const GammaSmartPagination({
  1. Key? key,
  2. required GammaController gammaSmartController,
  3. required ScrollController scrollController,
  4. required Widget child,
  5. required int itemCount,
  6. Future<void> onRefresh()?,
  7. Future<void> onLoadMore()?,
  8. Widget? header,
  9. Widget? noMoreDataWidget,
  10. Widget? loadingFailedWidget,
  11. Widget? refreshFailedWidget,
  12. Widget? noInitialDataWidget,
  13. Widget? loadingIndicator,
  14. double? scrollSensitivityTrigger,
  15. 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,
});