PagingState<PageKeyType, ItemType> class
abstract
Represents the state of a paginated layout.
- Available extensions
- Annotations
Constructors
-
PagingState({List<
List< ? pages, List<ItemType> >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<
The list of items fetched so far. A flattened version of pages.PageKeyType, ItemType> , provided by the PagingStateExtension extensionno setter -
keys
→ List<
PageKeyType> ? -
The keys of the pages fetched so far.
no setter
- lastPageIsEmpty → bool
-
Available on PagingState<
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.PageKeyType, ItemType> , provided by the PagingStateExtension extensionno setter - nextIntPageKey → int
-
Available on PagingState<
Convenience method to get the next page key.int, ItemType> , provided by the IntPagingStateExtension extensionno 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< ? pages = const Omit(), Defaulted<List< ?>ItemType> >List< ? keys = const Omit(), Defaulted<PageKeyType> ?>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<
Convenience method to filter the items of the state by applying a predicate function to each item.PageKeyType, ItemType> , provided by the PagingStateExtension extension -
mapItems(
ItemType mapper(ItemType item)) → PagingState< PageKeyType, ItemType> -
Available on PagingState<
Convenience method to update the items of the state by applying a mapper function to each item.PageKeyType, ItemType> , provided by the PagingStateExtension extension -
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