AsyncSuccess<T> class
final
Represents the success state of an async operation with data.
This state indicates that an async operation completed successfully and contains the resulting data.
Example:
final state = AsyncSuccess('Hello World');
print(state.isSuccess); // true
print(state.data); // 'Hello World'
- Inheritance
-
- Object
- AsyncState<
T> - AsyncSuccess
Constructors
- AsyncSuccess(T value)
-
Creates a success state with the given value.
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
- value → T
-
The successful result data.
final
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