SmartPagination<T>.columnWithCubit constructor
SmartPagination<T>.columnWithCubit ({
- Key? key,
- required SmartPaginationCubit<
T> cubit, - required Widget itemBuilder(
- BuildContext context,
- List<
T> documents, - int index
- double? heightOfInitialLoadingAndEmptyWidget,
- Widget onError(
- Exception exception
- void onReachedEnd(
- SmartPaginationLoaded<
T> loader
- SmartPaginationLoaded<
- void onLoaded(
- SmartPaginationLoaded<
T> loader
- SmartPaginationLoaded<
- Widget emptyWidget = const EmptyDisplay(),
- Widget loadingWidget = const InitialLoader(),
- Widget bottomLoader = const BottomLoader(),
- Widget? header,
- SmartPaginationLoaded<
T> beforeBuild(- SmartPaginationLoaded<
T> state
- SmartPaginationLoaded<
- ListBuilder<
T> ? listBuilder, - EdgeInsetsGeometry padding = const EdgeInsetsGeometry.all(0),
- bool allowImplicitScrolling = false,
- Widget? separator,
- double spacing = 4,
- SmartPaginationRefreshedChangeListener? refreshListener,
- List<
SmartPaginationFilterChangeListener< ? filterListeners,T> > - ScrollController? scrollController,
- double? cacheExtent,
- Widget firstPageLoadingBuilder(
- BuildContext context
- Widget firstPageErrorBuilder(
- BuildContext context,
- Exception error,
- VoidCallback retry
- Widget firstPageEmptyBuilder(
- BuildContext context
- Widget loadMoreLoadingBuilder(
- BuildContext context
- Widget loadMoreErrorBuilder(
- BuildContext context,
- Exception error,
- VoidCallback retry
- Widget loadMoreNoMoreItemsBuilder(
- BuildContext context
- 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;