PagifyController<E> class

A controller for managing the data and scroll state of a Pagify widget.

This class provides methods for manipulating the item list, controlling the scroll position, and notifying the pagination system when changes occur.

Constructors

PagifyController()

Properties

getItemsLength int
get data list length int
no setter
hashCode int
The hash code for this object.
no setterinherited
isError bool
check if current state is error bool
no setter
isLoading bool
check if current state is loading bool
no setter
isSuccess bool
check if current state is success bool
no setter
items List<E>
get current data List
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accessElement(int index) → E?
Returns the element at the given index, or null if out of range.
addAtBeginning(E item) → void
Inserts item at the beginning of the list.
addItem(E item) → void
Adds item to the end of the list.
addItemAt(int index, E item) → void
Inserts item at the specified index in the list.
assignToFullData() List<E>
back _items to current full data
clear() → void
Clears all items from the list.
dispose() → void
Disposes the controller and releases resources.
filter(bool condition(E item)) List<E>
Returns a new list containing items that satisfy the condition.
filterAndUpdate(bool condition(E item)) List<E>
Filters the list in-place based on the condition and updates listeners.
getRandomItem() → E?
Returns a random item from the list, or null if the list is empty.
loadMore() Future<void>
force fetching data with next page
moveToMaxBottom({Duration? duration, Curve? curve}) Future<void>
Smoothly scrolls to the bottom of the list/grid.
moveToMaxTop({Duration? duration, Curve? curve}) Future<void>
Smoothly scrolls to the top of the list/grid.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() Future<void>
get data like first time as refreshing
reload() Future<void>
reload the list
removeAt(int index) → void
Removes the element at index.
removeItem(E item) → void
Removes item from the list.
removeWhere(bool condition(E item)) → void
Removes all elements that satisfy the condition.
replaceWith(int oldItemIndex, E item) → void
Replaces the element at oldItemIndex with item.
retry() FutureOr<void>
remake the last request when its fail for example
sort(int compare(E a, E b)) → void
Sorts the list in-place based on the provided compare function.
toString() String
A string representation of this object.
inherited

Operators

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