SuperScrollController<T> class
A controller that manages the pagination state for SuperListView or SuperGridView.
- Inheritance
-
- Object
- ChangeNotifier
- SuperScrollController
Constructors
-
SuperScrollController({required Future<
SuperScrollResult< onFetch(int page)})T> >
Properties
- currentPage → int
-
The current page number.
no setter
- error → Object?
-
The error encountered during the last fetch, if any.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- hasMore → bool
-
Whether there are more items to load.
no setter
- isLoading → bool
-
Whether the controller is currently loading data.
no setter
-
items
→ List<
T> -
The list of items currently loaded.
no setter
-
onFetch
→ Future<
SuperScrollResult< Function(int page)T> > -
Callback to fetch data for a specific page.
final
- 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. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
loadMore(
) → Future< void> - Loads the next page of data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
refresh(
{int? page}) → Future< void> -
Refreshes the data.
If
pageis provided, it re-fetches only that specific page and replaces its items. Ifpageis null, it clears everything and starts over from page 1. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void - Clears the items and resets the controller state.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited