PaginationManager<T> class
A class for managing paginated data.
It provides methods for fetching paginated items and resetting the manager to its initial state.
The PaginationManager class is generic and can be used with any type of data.
Constructors
-
PaginationManager({required PaginatedRepository<
T> repository, int limitPerPage = 20}) - Creates a new instance of PaginationManager.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMore → bool
-
Indicates whether there are more items to load.
no setter
- isLoading → bool
-
The current loading state.
no setter
-
items
→ List<
T> -
The current items.
no setter
- limitPerPage → int
-
The maximum number of items to fetch per page.
final
-
repository
→ PaginatedRepository<
T> -
The implemented repository for fetching paginated items.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addItem(
T item) → void - Method to add an item
-
fetchNextPage(
) → Future< PaginationResult< T> > - A method for fetching the next page of items.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeAt(
int index) → void - Method to remove item by index
-
removeItem(
T item) → void - Method to remove an item
-
reset(
) → void - Resets the pagination manager to its initial state.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateItem(
int index, T newItem) → void - Method to update an item at a specific index
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited