Async<T> class
Async<T>
represent data in its asynchronous form.
Constructors
- Async({required AsyncStatus status, T? data, Object? error, StackTrace? stackTrace})
-
Create async data with its raw fields:
status, data, error and stackTrace.
const
- Async.error({T? data, required Object error, StackTrace stackTrace = StackTrace.empty})
-
Create async data with error status.
const
- Async.loaded({required T? data})
-
Create async data with loaded status.
const
- Async.loading({T? data})
-
Create async data with loading status.
const
Properties
- data → T?
-
The underlining data.
final
- error → Object?
-
The error raised when resolving the data.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- requireData → T
-
Get underlining data and assert it's not null.
no setter
- requireError → Object
-
Get error and assert it's not null.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The stackTrace associated with error.
final
- status → AsyncStatus
-
Current asynchronous status.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override