AsyncLoading<T> class
final
Represents the loading state of an async operation.
This state indicates that an async operation is in progress and no data is available yet.
Example:
final state = AsyncLoading<String>();
print(state.isLoading); // true
- Inheritance
-
- Object
- AsyncState<
T> - AsyncLoading
Constructors
- AsyncLoading()
-
const
Properties
- data → T?
-
The data from the async operation, if available.
no setterinherited
- error → Object?
-
The error from the async operation, if any.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Whether this state represents an error.
no setterinherited
- isLoading → bool
-
Whether this state represents a loading operation.
no setterinherited
- isSuccess → bool
-
Whether this state represents a successful operation with data.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The stack trace from the async operation error, if any.
no setterinherited
Methods
-
map<
R> ({R loading()?, R success(T)?, R error(Object?, StackTrace?)?}) → R? -
Maps the async state to a value based on its current state.
inherited
-
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