PaginateApiView<T> class
A paginated view widget that automatically integrates scrollview_observer for programmatic scroll navigation (animateToIndex, jumpToIndex, etc.)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PaginateApiView
Constructors
-
PaginateApiView({Key? key, required SmartPaginationLoaded<
T> loadedState, required PaginateBuilderType itemBuilderType, required Widget itemBuilder(BuildContext context, List<T> documents, int index), SmartPaginationCubit<T> ? cubit, double? heightOfInitialLoadingAndEmptyWidget, SliverGridDelegate gridDelegate = const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), Widget separator = const EmptySeparator(), bool shrinkWrap = false, bool reverse = false, Axis scrollDirection = Axis.vertical, AxisDirection? staggeredAxisDirection, EdgeInsetsGeometry padding = const EdgeInsets.all(0), ScrollPhysics? physics, ScrollController? scrollController, bool allowImplicitScrolling = false, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, PageController? pageController, void onPageChanged(int)?, Widget? header, Widget? bottomLoader, void fetchPaginatedList()?, double? cacheExtent, Widget customViewBuilder(BuildContext context, List<T> items, bool hasReachedEnd, VoidCallback? fetchMore)?, void onReorder(int oldIndex, int newIndex)?, Widget loadMoreLoadingBuilder(BuildContext context)?, Widget loadMoreErrorBuilder(BuildContext context, Exception error, VoidCallback retry)?, Widget loadMoreNoMoreItemsBuilder(BuildContext context)?, int invisibleItemsThreshold = 3, VoidCallback? retryLoadMore, bool enableObserver = true, void onObserverCreated(dynamic controller)?}) -
const
Properties
- allowImplicitScrolling → bool
-
final
- bottomLoader → Widget?
-
final
- cacheExtent → double?
-
final
-
cubit
→ SmartPaginationCubit<
T> ? -
The cubit to attach the observer controller to.
When provided, the observer controller will be automatically attached
for scroll navigation methods (animateToIndex, jumpToIndex, etc.)
final
-
customViewBuilder
→ Widget Function(BuildContext context, List<
T> items, bool hasReachedEnd, VoidCallback? fetchMore)? -
Custom view builder for complete control over the view
When using PaginateBuilderType.custom, this builder is called with:
final
- enableObserver → bool
-
Whether to enable the built-in scrollview_observer for scroll navigation.
Defaults to true.
final
- fetchPaginatedList → void Function()?
-
final
-
final
- gridDelegate → SliverGridDelegate
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
final
- heightOfInitialLoadingAndEmptyWidget → double?
-
final
- invisibleItemsThreshold → int
-
Number of items before the end that triggers loading more items
final
-
itemBuilder
→ Widget Function(BuildContext context, List<
T> documents, int index) -
final
- itemBuilderType → PaginateBuilderType
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior
-
final
-
loadedState
→ SmartPaginationLoaded<
T> -
final
- loadMoreErrorBuilder → Widget Function(BuildContext context, Exception error, VoidCallback retry)?
-
Builder for load more error state with retry capability
final
- loadMoreLoadingBuilder → Widget Function(BuildContext context)?
-
Builder for load more loading indicator
final
- loadMoreNoMoreItemsBuilder → Widget Function(BuildContext context)?
-
Builder for end of list indicator (no more items to load)
final
- onObserverCreated → void Function(dynamic controller)?
-
Callback when the observer controller is created.
Useful for accessing the observer controller externally.
final
- onPageChanged → void Function(int)?
-
final
- onReorder → void Function(int oldIndex, int newIndex)?
-
Callback for reordering items in ReorderableListView
Called with the old index and new index when an item is moved
final
- padding → EdgeInsetsGeometry
-
final
- pageController → PageController?
-
final
- physics → ScrollPhysics?
-
final
- retryLoadMore → VoidCallback?
-
Retry callback for load more errors
final
- reverse → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
final
- scrollDirection → Axis
-
final
- separator → Widget
-
final
- shrinkWrap → bool
-
final
- staggeredAxisDirection → AxisDirection?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PaginateApiView< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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