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
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, ornullif out of range. -
addAtBeginning(
E item) → void -
Inserts
itemat the beginning of the list. -
addItem(
E item) → void -
Adds
itemto the end of the list. -
addItemAt(
int index, E item) → void -
Inserts
itemat the specifiedindexin the list. -
assignToFullData(
) → List< E> -
back
_itemsto 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
conditionand updates listeners. -
getRandomItem(
) → E? -
Returns a random item from the list, or
nullif 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
itemfrom 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
oldItemIndexwithitem. -
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
comparefunction. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited