PagedValueNotifier<Key, Value> class abstract

A PagedValueNotifier that uses a PagedListenable to load data.

This class is useful when you need to load data from a server using a PagedListenable and want to keep the UI-driven refresh signals in the PagedListenable.

PagedValueNotifier is a ValueNotifier that emits a PagedValue whenever the data is loaded or an error occurs.

Inheritance
Implementers

Constructors

PagedValueNotifier(PagedValue<Key, Value> _initialValue)
Creates a PagedValueNotifier

Properties

currentItems List<Value>
Returns the currently loaded items
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value PagedValue<Key, Value>
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
appendLastPage(List<Value> newItems) → void
Appends newItems to the previously loaded ones and sets the next page key to null.
appendPage({required List<Value> newItems, required Key nextPageKey}) → void
Appends newItems to the previously loaded ones and replaces the next page's key.
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
doInitialLoad() Future<void>
Load initial data from the server.
loadMore(Key nextPageKey) Future<void>
Load more data from the server using nextPageKey.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh({bool resetValue = true}) Future<void>
Refresh the data presented by this PagedValueNotifier.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
retry() Future<void>
Retry any failed load requests.
toString() String
A string representation of this object.
inherited

Operators

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