AsyncValue<T> class

A wrapper and handler for a value that is asynchronous (from a Future).

Constructors

AsyncValue(Future<T> future)
AsyncValue.from(Object? value)
factory

Properties

error Object?
no setter
future Future<T>
no setter
hasError bool
Returns true if the value has an execution error.
no setter
hashCode int
The hash code for this object.
no setterinherited
isLoaded bool
Returns true if value is loaded.
no setter
isLoadedOK bool
Returns true if isLoaded and no error (OK).
no setter
isLoadedWithError bool
Returns true if isLoaded and has an error
no setter
onLoad EventStream<T?>
Handles load events.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes the value, error and future associated.
get() → T?
Returns the value (only if already loaded).
getAsync() Future<T?>
Returns a Future<T> with the value.
getIfLoaded() → T?
Returns the value if loaded.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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