SmartPaginationReorderableListView<T> class

A paginated ReorderableListView widget with automatic pagination support.

This widget provides a convenient way to display paginated data in a ReorderableListView with built-in support for loading states, error handling, infinite scrolling, and drag-and-drop reordering.

Example usage:

SmartPaginationReorderableListView.withProvider(
  request: PaginationRequest(page: 1, pageSize: 20),
  provider: PaginationProvider.future((request) => fetchTasks(request)),
  itemBuilder: (context, items, index) {
    return ListTile(
      key: ValueKey(items[index].id),
      title: Text(items[index].title),
    );
  },
  onReorder: (oldIndex, newIndex) {
    // Handle reorder logic
  },
)
Inheritance

Constructors

SmartPaginationReorderableListView.withCubit({Key? key, required SmartPaginationCubit<T> cubit, required Widget itemBuilder(BuildContext context, List<T> documents, int index), required void onReorder(int oldIndex, int newIndex)?, double? heightOfInitialLoadingAndEmptyWidget, Widget onError(Exception exception)?, void onReachedEnd(SmartPaginationLoaded<T> loader)?, void onLoaded(SmartPaginationLoaded<T> loader)?, Widget emptyWidget = const EmptyDisplay(), Widget loadingWidget = const InitialLoader(), Widget bottomLoader = const BottomLoader(), bool shrinkWrap = false, bool reverse = false, Axis scrollDirection = Axis.vertical, EdgeInsetsGeometry padding = const EdgeInsetsGeometry.all(0), ScrollPhysics? physics, ScrollController? scrollController, bool allowImplicitScrolling = false, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, Widget? header, Widget? footer, SmartPaginationLoaded<T> beforeBuild(SmartPaginationLoaded<T> state)?, ListBuilder<T>? listBuilder, double? cacheExtent, Widget? separator, double spacing = 4, 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, SmartPaginationRefreshedChangeListener? refreshListener, List<SmartPaginationFilterChangeListener<T>>? filterListeners})
Creates a SmartPaginationReorderableListView with an external cubit.
SmartPaginationReorderableListView.withProvider({Key? key, required PaginationRequest request, required PaginationProvider<T> provider, required Widget itemBuilder(BuildContext context, List<T> documents, int index), required void onReorder(int oldIndex, int newIndex)?, double? heightOfInitialLoadingAndEmptyWidget, Widget onError(Exception exception)?, void onReachedEnd(SmartPaginationLoaded<T> loader)?, void onLoaded(SmartPaginationLoaded<T> loader)?, Widget emptyWidget = const EmptyDisplay(), Widget loadingWidget = const InitialLoader(), Widget bottomLoader = const BottomLoader(), bool shrinkWrap = false, bool reverse = false, Axis scrollDirection = Axis.vertical, EdgeInsetsGeometry padding = const EdgeInsetsGeometry.all(0), ScrollPhysics? physics, ScrollController? scrollController, bool allowImplicitScrolling = false, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, Widget? header, Widget? footer, SmartPaginationLoaded<T> beforeBuild(SmartPaginationLoaded<T> state)?, ListBuilder<T>? listBuilder, double? cacheExtent, Widget? separator, double spacing = 4, 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, SmartPaginationRefreshedChangeListener? refreshListener, List<SmartPaginationFilterChangeListener<T>>? filterListeners, OnInsertionCallback<T>? onInsertionCallback, VoidCallback? onClear, Logger? logger, int maxPagesInMemory = 5, RetryConfig? retryConfig, Duration? dataAge})
Creates a SmartPaginationReorderableListView with a provider for data fetching.

Properties

allowImplicitScrolling bool
finalinherited
beforeBuild SmartPaginationLoaded<T> Function(SmartPaginationLoaded<T> state)?
finalinherited
bottomLoader Widget
finalinherited
cacheExtent double?
finalinherited
cubit SmartPaginationCubit<T>
finalinherited
customViewBuilder Widget Function(BuildContext context, List<T> items, bool hasReachedEnd, VoidCallback? fetchMore)?
Custom view builder for complete control over the view Only used when itemBuilderType is PaginateBuilderType.custom
finalinherited
emptyWidget Widget
finalinherited
firstPageEmptyBuilder Widget Function(BuildContext context)?
Builder for first page empty state (no items found) If not provided, falls back to emptyWidget
finalinherited
firstPageErrorBuilder Widget Function(BuildContext context, Exception error, VoidCallback retry)?
Builder for first page error state with retry capability If not provided, falls back to onError
finalinherited
firstPageLoadingBuilder Widget Function(BuildContext context)?
Builder for first page loading state If not provided, falls back to loadingWidget
finalinherited
finalinherited
gridDelegate SliverGridDelegate
finalinherited
hashCode int
The hash code for this object.
no setterinherited
finalinherited
heightOfInitialLoadingAndEmptyWidget double?
finalinherited
internalCubit bool
finalinherited
invisibleItemsThreshold int
Number of items before the end that triggers loading more items Default is 3 - starts loading when user is 3 items away from the end
finalinherited
itemBuilder Widget Function(BuildContext context, List<T> documents, int index)
finalinherited
itemBuilderType PaginateBuilderType
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
finalinherited
listBuilder ListBuilder<T>?
finalinherited
listeners List<SmartPaginationChangeListener>?
finalinherited
loadingWidget Widget
finalinherited
loadMoreErrorBuilder Widget Function(BuildContext context, Exception error, VoidCallback retry)?
Builder for load more error state with retry capability
finalinherited
loadMoreLoadingBuilder Widget Function(BuildContext context)?
Builder for load more loading indicator If not provided, falls back to bottomLoader
finalinherited
loadMoreNoMoreItemsBuilder Widget Function(BuildContext context)?
Builder for end of list indicator (no more items to load)
finalinherited
onError Widget Function(Exception exception)?
finalinherited
onLoaded → void Function(SmartPaginationLoaded<T> loader)?
finalinherited
onPageChanged → void Function(int)?
finalinherited
onReachedEnd → void Function(SmartPaginationLoaded<T> loader)?
finalinherited
onReorder → void Function(int oldIndex, int newIndex)?
Callback for reordering items in ReorderableListView Only used when itemBuilderType is PaginateBuilderType.reorderableListView
finalinherited
padding EdgeInsetsGeometry
finalinherited
pageController PageController?
finalinherited
physics ScrollPhysics?
finalinherited
reverse bool
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
finalinherited
scrollDirection Axis
finalinherited
separator Widget
finalinherited
shrinkWrap bool
finalinherited
staggeredAxisDirection AxisDirection?
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SmartPagination<T>>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited