ApiSuccess<T> class

Successful outcome wrapper.

Inheritance

Constructors

ApiSuccess(T value)
const

Properties

data → T?
Data payload if successful, null otherwise.
no setterinherited
error → ApiError?
Error details if failed, null otherwise.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isFailure → bool
true if the request failed.
no setterinherited
isSuccess → bool
true if 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