URxState class

Observable UPageState for a page's loading/error/empty UI. final URxState state = URxState(); state.loading(); await load(); state.loaded();

Inheritance

Constructors

URxState([UPageState initial = UPageState.initial])
Starts at UPageState.initial.

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ UPageState
The current value; setting it notifies listeners when it changed. count.value++
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
call(UPageState newValue) → UPageState
Sets the value like a function and returns it. count(5)
inherited
dispose() → void
Discards any resources used by the object.
inherited
emptying() → UPageState
Switches to empty.
error() → UPageState
Switches to error.
initial() → UPageState
Switches to initial.
isEmpty() → bool
True when loaded but empty.
isError() → bool
True after a failure.
isInitial() → bool
True before the first load.
isLoaded() → bool
True when data is shown.
isLoading() → bool
True while loading.
isPaging() → bool
True while loading the next page.
loaded() → UPageState
Switches to loaded.
loading() → UPageState
Switches to loading.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
paging() → UPageState
Switches to paging.
refresh() → void
Notifies listeners without changing the value (after mutating an object inside).
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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