ApiLoading<T> class
final
Represents a loading / in-flight request.
- Implemented types
-
- ApiResponse<
T>
- ApiResponse<
Constructors
- ApiLoading()
-
const
Properties
- dataOrNull → T?
-
Returns the response data, or
nullwhen not in the success state.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- isFailure → bool
-
Returns
truewhen the request failed.no setteroverride - isLoading → bool
-
Returns
truewhile the request is in-flight.no setteroverride - isSuccess → bool
-
Returns
truewhen the request succeeded.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
R> (R transform(T data)) → ApiResponse< R> -
Applies
transformto the success payload, producing an ApiResponse of the new typeR.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
when<
R> ({required R loading(), required R success(T data), required R failure(PrimekitException error)}) → R -
Exhaustively maps each state to a value of type
R.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited