ResultNotifier<T> class

ResultNotifier is just like ValueNotifier but support to hold error along with value.

ResultNotifier holds 2-state Result, which could be either a data or an error.

When ResultNotifier.result changes, it notifies its listeners

Inheritance
Mixed in types

Constructors

ResultNotifier(T value)
Create ResultNotifier with value
ResultNotifier.error(Object error, [StackTrace stackTrace])
Create ResultNotifier with error stackTrace is optional, will be null if not specified.

Properties

error Object
Get the error of the result
read-only, inherited
hasError bool
Check whether result is an error
read-only, inherited
hashCode int
The hash code for this object.
read-only, inherited
hasListeners bool
Whether any listeners are currently registered.
@protected, read-only, inherited
hasValue bool
Check whether result is a value
read-only, inherited
result Result<T>
Get 2-state result
read / write, override-getter
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stackTrace StackTrace
Get the stackTrace of the result
read-only, inherited
value → T
Get the value of the result
read-only, inherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
asValueListenable() ValueListenable<Result<T>>
Wrap ResultListenable as ValueListenable, so it can be be used with anything supports ValueListenable.
inherited
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).
@mustCallSuper, inherited
fixError(ErrorFixer<T> fixer) → T
Update store with return value from fixer if store holds a error Returns the return value from fixer if store holds an error before, Returns the store value otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
putError(Object error, [StackTrace stackTrace]) → void
Put error into store stackTrace is optional
putValue(T value) → T
Put value into store
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
updateValue(ValueUpdater<T> updater) bool
Update store value with updater if store holds a value

Operators

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