Deferred<T> class abstract

Constructors

Deferred()
const
Deferred.error(Object error, StackTrace? stackTrace)
const
factory
Deferred.idle()
const
factory
Deferred.inProgress()
const
factory
Deferred.success(T result)
const
factory

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

flatMap<R>(Deferred<R> f(T result)) → Deferred<R>
Chains two Deferred values in sequence, using the result of callback f to determine the next value.
getOrElse(T defaultValue) → T
Returns the success value if available, or the provided defaultValue.
getOrThrow() → T
Returns the success value if available, or throws an exception.
mapBoth<R>({required R success(T result), required Object error(Object error)}) → Deferred<R>
Transforms both the contained success and error values based on the results of the callback functions success and error respectively.
mapError(Object f(Object error)) → Deferred<T>
Transforms the contained error value based on the result of the callback function f.
mapSuccess<R>(R f(T result)) → Deferred<R>
Transforms the contained success value based on the result of the callback function f.
maybeWhen<R>({R success(T result)?, R error(Object error, StackTrace? stackTrace)?, R inProgress()?, R idle()?, required R orElse()}) → R
Similar to when, but doesn't require all states to be explicitly handled, therefore the orElse callback must be provided as a fallback handler.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
when<R>({required R success(T result), required R error(Object error, StackTrace? stackTrace), required R inProgress(), required R idle()}) → R
Provides several callbacks for handling common states of async data. It functions as a rudimentary form of pattern matching.

Operators

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