ApiLoading<T> class final

Represents a loading / in-flight request.

Implemented types

Constructors

ApiLoading()
const

Properties

dataOrNull → T?
Returns the response data, or null when not in the success state.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isFailure bool
Returns true when the request failed.
no setteroverride
isLoading bool
Returns true while the request is in-flight.
no setteroverride
isSuccess bool
Returns true when 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 transform to the success payload, producing an ApiResponse of the new type R.
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