SmartPaginationColumn<T>.withCubit constructor

SmartPaginationColumn<T>.withCubit({
  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. ScrollController? scrollController,
  18. double? cacheExtent,
  19. Widget? separator,
  20. double spacing = 4,
  21. Widget firstPageLoadingBuilder(
    1. BuildContext context
    )?,
  22. Widget firstPageErrorBuilder(
    1. BuildContext context,
    2. Exception error,
    3. VoidCallback retry
    )?,
  23. Widget firstPageEmptyBuilder(
    1. BuildContext context
    )?,
  24. Widget loadMoreLoadingBuilder(
    1. BuildContext context
    )?,
  25. Widget loadMoreErrorBuilder(
    1. BuildContext context,
    2. Exception error,
    3. VoidCallback retry
    )?,
  26. Widget loadMoreNoMoreItemsBuilder(
    1. BuildContext context
    )?,
  27. int invisibleItemsThreshold = 3,
  28. SmartPaginationRefreshedChangeListener? refreshListener,
  29. List<SmartPaginationFilterChangeListener<T>>? filterListeners,
})

Creates a SmartPaginationColumn with an external cubit.

Use this constructor when you want to manage the cubit externally, such as when using it as a global variable or sharing it across screens.

Implementation

SmartPaginationColumn.withCubit({
  super.key,
  required super.cubit,
  required super.itemBuilder,
  super.heightOfInitialLoadingAndEmptyWidget,
  super.onError,
  super.onReachedEnd,
  super.onLoaded,
  super.emptyWidget,
  super.loadingWidget,
  super.bottomLoader,
  super.header,
  super.footer,
  super.beforeBuild,
  super.listBuilder,
  super.padding,
  super.allowImplicitScrolling,
  super.scrollController,
  super.cacheExtent,
  super.separator,
  super.spacing,
  super.firstPageLoadingBuilder,
  super.firstPageErrorBuilder,
  super.firstPageEmptyBuilder,
  super.loadMoreLoadingBuilder,
  super.loadMoreErrorBuilder,
  super.loadMoreNoMoreItemsBuilder,
  super.invisibleItemsThreshold,
  super.refreshListener,
  super.filterListeners,
}) : super.columnWithCubit();