SmartPagination<T>.columnWithCubit constructor

SmartPagination<T>.columnWithCubit({
  1. Key? key,
  2. required SmartPaginationCubit<T> cubit,
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. List<T> documents,
    3. int index
    ),
  4. double? heightOfInitialLoadingAndEmptyWidget,
  5. Widget onError(
    1. Exception exception
    )?,
  6. void onReachedEnd(
    1. SmartPaginationLoaded<T> loader
    )?,
  7. void onLoaded(
    1. SmartPaginationLoaded<T> loader
    )?,
  8. Widget emptyWidget = const EmptyDisplay(),
  9. Widget loadingWidget = const InitialLoader(),
  10. Widget bottomLoader = const BottomLoader(),
  11. Widget? header,
  12. Widget? footer,
  13. SmartPaginationLoaded<T> beforeBuild(
    1. SmartPaginationLoaded<T> state
    )?,
  14. ListBuilder<T>? listBuilder,
  15. EdgeInsetsGeometry padding = const EdgeInsetsGeometry.all(0),
  16. bool allowImplicitScrolling = false,
  17. Widget? separator,
  18. double spacing = 4,
  19. SmartPaginationRefreshedChangeListener? refreshListener,
  20. List<SmartPaginationFilterChangeListener<T>>? filterListeners,
  21. ScrollController? scrollController,
  22. double? cacheExtent,
  23. Widget firstPageLoadingBuilder(
    1. BuildContext context
    )?,
  24. Widget firstPageErrorBuilder(
    1. BuildContext context,
    2. Exception error,
    3. VoidCallback retry
    )?,
  25. Widget firstPageEmptyBuilder(
    1. BuildContext context
    )?,
  26. Widget loadMoreLoadingBuilder(
    1. BuildContext context
    )?,
  27. Widget loadMoreErrorBuilder(
    1. BuildContext context,
    2. Exception error,
    3. VoidCallback retry
    )?,
  28. Widget loadMoreNoMoreItemsBuilder(
    1. BuildContext context
    )?,
  29. int invisibleItemsThreshold = 3,
})

Creates a pagination widget as a Column layout (non-scrollable) with an external Cubit

Implementation

SmartPagination.columnWithCubit({
  super.key,
  required this.cubit,
  required this.itemBuilder,
  this.heightOfInitialLoadingAndEmptyWidget,
  this.onError,
  this.onReachedEnd,
  this.onLoaded,
  this.emptyWidget = const EmptyDisplay(),
  this.loadingWidget = const InitialLoader(),
  this.bottomLoader = const BottomLoader(),
  this.header,
  this.footer,
  this.beforeBuild,
  this.listBuilder,
  this.padding = const EdgeInsetsGeometry.all(0),
  this.allowImplicitScrolling = false,
  Widget? separator,
  double spacing = 4,
  SmartPaginationRefreshedChangeListener? refreshListener,
  List<SmartPaginationFilterChangeListener<T>>? filterListeners,
  this.scrollController,
  this.cacheExtent,
  this.firstPageLoadingBuilder,
  this.firstPageErrorBuilder,
  this.firstPageEmptyBuilder,
  this.loadMoreLoadingBuilder,
  this.loadMoreErrorBuilder,
  this.loadMoreNoMoreItemsBuilder,
  this.invisibleItemsThreshold = 3,
}) : itemBuilderType = PaginateBuilderType.listView,
     gridDelegate = const SliverGridDelegateWithFixedCrossAxisCount(
       crossAxisCount: 2,
     ),
     separator = separator ?? SizedBox(height: spacing),
     shrinkWrap = true,
     reverse = false,
     scrollDirection = Axis.vertical,
     staggeredAxisDirection = null,
     physics = const NeverScrollableScrollPhysics(),
     keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
     pageController = null,
     onPageChanged = null,
     customViewBuilder = null,
     onReorder = null,
     internalCubit = false,
     listeners =
         refreshListener != null || filterListeners?.isNotEmpty == true
         ? [if (refreshListener != null) refreshListener, ...?filterListeners]
         : null;