ListSmithController<T extends Object> class

Drives a ListSmith.async list from code: a refresh button, a tab re-tap, a re-read after a local write, a logout, a scan.

Intents only, never the pager or its state. Want to hear about events instead? That's ListSmithObserver. Holds nothing, so there's nothing to dispose.

Constructors

ListSmithController()
Creates it.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

endSearch() → Future<void>
Ends a search, waiting or showing, and lands on what the list's query holds, as typed. Completes once its page 0 is over, or at once when that already shows.
invalidate() → Future<void>
Re-reads every loaded page in place, keeping the user's scroll position, because your data changed locally. Pages report FetchTrigger.invalidated.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → Future<void>
Reloads exactly as a pull would, running the configured Reload (ResetToFirstPage when the list has no pull). While searching, it reloads the search.
remove(T item) → void
Hides every loaded copy of item by its id, until those pages are read again.
removeAsync(T item, {required Future<void> commit, ValueSetter<Exception>? onFailure}) → Future<void>
remove before your server has it. On failure the item comes back and onFailure gets the exception.
reset() → Future<void>
Starts the list over from page 0: a logout, an account switch, a filter outside search. That page reports FetchTrigger.invalidated.
Searches query like typing it, through fetchPage or the search's own fetcher. The list's debounce and min length apply unless passed. Needs an attached list with an AsyncSearch.
toString() → String
A string representation of this object.
inherited
upsert(T item) → void
Shows item wherever a copy with its id is loaded, or at the top of the feed if none is. For a change that's already true on your server or store, and lasts until those pages are read again.
upsertAsync(T draft, {required Future<T> commit, ValueSetter<Exception>? onFailure}) → Future<void>
upsert before your server has it: draft shows until commit answers, then the answer does. On failure the draft goes and onFailure gets the exception, so nothing throws. The id can't change.

Operators

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