PagingState<PageKeyType, ItemType> class abstract

Represents the state of a paginated layout.

Available extensions
Annotations

Constructors

PagingState({List<List<ItemType>>? pages, List<PageKeyType>? keys, Object? error, bool hasNextPage, bool isLoading})
Creates a PagingState with the given parameters.
factory

Properties

error Object?
The last error that occurred while fetching a page. This is null if no error occurred.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasNextPage bool
Will be true if there is a next page to be fetched.
no setter
isLoading bool
Will be true if a page is currently being fetched.
no setter
items List<ItemType>?

Available on PagingState<PageKeyType, ItemType>, provided by the PagingStateExtension extension

The list of items fetched so far. A flattened version of pages.
no setter
keys List<PageKeyType>?
The keys of the pages fetched so far.
no setter
lastPageIsEmpty bool

Available on PagingState<PageKeyType, ItemType>, provided by the PagingStateExtension extension

Convenience getter to check if the last page is empty. This is useful if your API returns an empty page when there are no more items to fetch.
no setter
nextIntPageKey int

Available on PagingState<int, ItemType>, provided by the IntPagingStateExtension extension

Convenience method to get the next page key.
no setter
pages List<List<ItemType>>?
The pages fetched so far.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status PagingStatus

Available on PagingState, provided by the PagingStatusExtension extension

The current pagination status.
no setter

Methods

copyWith({Defaulted<List<List<ItemType>>?>? pages = const Omit(), Defaulted<List<PageKeyType>?>? keys = const Omit(), Defaulted<Object?>? error = const Omit(), Defaulted<bool>? hasNextPage = const Omit(), Defaulted<bool>? isLoading = const Omit()}) PagingState<PageKeyType, ItemType>
Creates a copy of this PagingState but with the given fields replaced by the new values. If a field is not provided, it will default to the current value.
filterItems(bool predicate(ItemType item)) PagingState<PageKeyType, ItemType>

Available on PagingState<PageKeyType, ItemType>, provided by the PagingStateExtension extension

Convenience method to filter the items of the state by applying a predicate function to each item.
mapItems(ItemType mapper(ItemType item)) PagingState<PageKeyType, ItemType>

Available on PagingState<PageKeyType, ItemType>, provided by the PagingStateExtension extension

Convenience method to update the items of the state by applying a mapper function to each item.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() PagingState<PageKeyType, ItemType>
Returns a copy this PagingState but all fields are reset to their initial values.
toString() String
A string representation of this object.
inherited

Operators

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