AsyncError<T> class
final
The error variant for an AsyncValue.
To be in this state, a Future or Stream emitted an error event.
- Inheritance
-
- Object
- AsyncValue<
T> - AsyncError
- Available extensions
- Annotations
-
- @immutable
Constructors
-
AsyncError.new(Object error, StackTrace stackTrace, Option<
T> previousData) -
Creates an AsyncError with the supplied
error
,stackTrace
, andpreviousData
.const
Properties
-
data
→ Option<
T> -
Available on AsyncValue<
Returns any data contained within this AsyncValue, includingT> , provided by the AsyncValueConvenience extensionpreviousData
for the AsyncLoading and AsyncError cases.no setter - error → Object
-
The emitted error associated with this AsyncError.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
previousData
→ Option<
T> -
The previous data (from a predecessor AsyncData), if it exists.
This can happen if a new Future/Stream is watched and the
Future/Stream it is replacing was in the AsyncData state.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace
-
The StackTrace corresponding with the error.
final
Methods
-
dataOr(
T defaultValue) → T -
Available on AsyncValue<
Returns any data contained within this AsyncValue, includingT> , provided by the AsyncValueConvenience extensionpreviousData
for the AsyncLoading and AsyncError cases. -
dataOrElse(
T defaultFn()) → T -
Available on AsyncValue<
Returns any data contained within this AsyncValue, includingT> , provided by the AsyncValueConvenience extensionpreviousData
for the AsyncLoading and AsyncError cases. -
fillInPreviousData(
Option< T> newPreviousData) → AsyncValue<T> -
Available on AsyncValue<
Fills in the AsyncLoading.previousData or AsyncError.previousData withT> , provided by the AsyncValueConvenience extensionnewPreviousData
if AsyncLoading.previousData or AsyncError.previousData are None. If AsyncLoading.previousData or AsyncError.previousData are Some, thennewPreviousData
will not be filled in. -
map<
R> (R mapper(T)) → AsyncValue< R> -
Available on AsyncValue<
Maps an AsyncValueT> , provided by the AsyncValueConvenience extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
unwrapOr(
T defaultValue) → T -
Available on AsyncValue<
Returns AsyncData.data ifT> , provided by the AsyncValueConvenience extensionthis
is an AsyncData. Otherwise, returnsdefaultValue
. -
unwrapOrElse(
T defaultFn()) → T -
Available on AsyncValue<
Returns AsyncData.data ifT> , provided by the AsyncValueConvenience extensionthis
is an AsyncData. Otherwise, calls and returns the result ofdefaultFn
. -
withoutPreviousData(
) → AsyncValue< T> -
Available on AsyncValue<
Fills in the AsyncLoading.previousData or AsyncError.previousData with None so that there is no previous data whatsoever in the AsyncValue. This also means that data will only be Some when this is AsyncData, which can be useful when you want to erase any non-relevant previous data.T> , provided by the AsyncValueConvenience extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override