SuperScrollController<T> class

A controller for SuperScroll and its variants.

It manages the list of items, loading state, error state, and selection mode.

Inheritance

Constructors

SuperScrollController({required Future<SuperScrollResult<T>> onFetch(int page)})

Properties

currentPage int
Current page number.
no setter
error Object?
The last error that occurred during fetching, if any.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMore bool
Whether there are more items to load.
no setter
isLoading bool
Whether the controller is currently loading more items.
no setter
isSelectionMode bool
Whether the controller is in selection mode.
no setter
items List<T>
The list of items currently loaded.
final
onFetch Future<SuperScrollResult<T>> Function(int page)
The callback that fetches new items for a given page.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItems Set<T>
The list of currently selected items.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearSelection() → void
Clears the current selection.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
isSelected(T item) bool
Returns whether a specific item is selected.
loadMore() Future<void>
Fetches the next page of items.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh({int? page}) Future<void>
Resets the controller and reloads the first page.
refreshFromPage(int page) Future<void>
Refreshes a specific page and everything after it.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
selectAll() → void
Selects all currently loaded items.
setItems(List<T> newItems, {bool hasMore = true}) → void
Directly sets items (useful for initial state or manual management).
toggleItemSelection(T item) → void
Toggles selection of a specific item.
toggleSelectionMode([bool? value]) → void
Toggles selection mode on or off.
toString() String
A string representation of this object.
inherited

Operators

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