ApiSuccess<T> class
Successful outcome wrapper.
Constructors
- ApiSuccess(T value)
-
const
Properties
- data → T?
-
Data payload if successful,
nullotherwise.no setterinherited - error → ApiError?
-
Error details if failed,
nullotherwise.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isFailure → bool
-
trueif the request failed.no setterinherited - isSuccess → bool
-
trueif the request succeeded.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
final
Methods
-
map<
R> (R mapper(T data)) → ApiResult< R> -
Maps successful result data into type
R.inherited -
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 success(T data), required R failure(ApiError error)}) → R -
Pattern match handler for success and failure outcomes.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited