Pagination<T, C, K> class

Pages maintainer utility of the provided T values with the specified K key identifying those items and their C cursor.

Constructors

Pagination({int perPage = 50, required PageProvider<T, C, K> provider, required K onKey(T), int compare(T, T)?, bool fulfilled(Iterable<T>) = _returnsTrue})

Properties

changes Stream<MapChangeNotification<K, T>>
Returns a Stream of changes of the items.
no setter
compare int Function(T, T)?
Callback, comparing the provided T items to order them in the items.
final
endCursor ↔ C?
Cursor of the last item in the items list.
getter/setter pair
fulfilled bool Function(Iterable<T>)
Callback, indicating whether the provided page is considered as fulfilled the request.
final
hashCode int
The hash code for this object.
no setterinherited
hasNext → RxBool
Indicator whether the items have next page.
final
hasPrevious → RxBool
Indicator whether the items have previous page.
final
isEmpty bool
Indicator whether this Pagination is empty.
no setter
items SortedObsMap<K, T>
Items fetched from the provider ordered by their T values.
latefinal
nextLoading → RxBool
Indicator whether the next page of items is being fetched.
final
onKey → K Function(T)
Callback, called when a key of type K identifying the provided T item is required.
final
perPage int
Items per Page to fetch.
final
previousLoading → RxBool
Indicator whether the previous page of items is being fetched.
final
provider PageProvider<T, C, K>
PageProvider providing the items.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startCursor ↔ C?
Cursor of the first item in the items list.
getter/setter pair

Methods

around({K? key, C? cursor}) Future<Page<T, C>?>
Fetches the Page around the provided key or cursor.
clear() Future<void>
Resets this Pagination to its initial state.
dispose() → void
Disposes this Pagination.
init(K? key) Future<void>
Fetches the initial Page of items.
next() Future<void>
Fetches a next page of the items.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previous() Future<void>
Fetches a previous page of the items.
put(T item, {bool ignoreBounds = false, bool store = true}) Future<void>
Adds the provided item to the items.
remove(K key, {bool store = true}) Future<void>
Removes the item with the provided key from the items and provider.
toString() String
A string representation of this object.
inherited

Operators

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