MoInfiniteScrollController<T> class

Controls the pagination state for InfiniteScrollFlow and SliverInfiniteScrollFlow.

You can optionally create and manage a controller yourself to call refresh from outside the widget (e.g., from an AppBar action). If you do not provide one, the widget creates its own internally.

Example:

final controller = MoInfiniteScrollController<MyItem>();

// Refresh from anywhere:
controller.refresh();
Inheritance

Properties

currentPage int
The next page number that will be fetched.
no setter
hasError bool
Whether the last fetch resulted in an error.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasReachedEnd bool
Whether the last fetch returned fewer items than limit, signalling that no more pages are available.
no setter
isLoading bool
Whether a fetch is currently in progress.
no setter
items List<T>
All items loaded so far.
no setter
lastError Object?
The error thrown by the last failed fetch, if any.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
fetchNextPage(PageFetcher<T> fetcher, int limit) Future<void>
Fetches the next page and appends results to items.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh(PageFetcher<T> fetcher, int limit) Future<void>
Resets the controller back to page 1 and fetches the first page.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited

Operators

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