PaginationState<T> class

State for pagination.

Annotations

Constructors

PaginationState({List<T> items = const [], int currentPage = 1, int lastPage = 1, bool isLoading = false, bool loadingInitialPage = true, bool hasError = false, int total = 0, String? searchQuery})
Creates a new PaginationState with the given values.
const

Properties

currentPage int
The current page in the pagination process.
final
hasError bool
Whether there is an error loading the current page.
final
hashCode int
The hash code for this object.
no setteroverride
hasNextPage bool
Checks if there is a next page to load for the current PaginationState.
no setter
isLoading bool
Whether the current page is being loaded.
final
items List<T>
All items fetched so far for the loaded pages.
final
lastPage int
The last page in the pagination process.
final
loadingInitialPage bool
Whether the initial page is being loaded.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchQuery String?
The search query to filter the items.
final
total int
The total number of items.
final

Methods

copyWith({List<T>? items, int? currentPage, int? lastPage, bool? isLoading, bool? loadingInitialPage, bool? hasError, int? total, String? searchQuery}) PaginationState<T>
Copies the current state with the given values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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