APIResponse<T> class

All API request returns a APIResponse.

If response is success, errors will be null and data will not.

Else, response is error response, errors will not be null, and data will not.

Inheritance

Constructors

APIResponse({T? data, APIError? errors})
Create APIResponse with generic types.

Properties

data ↔ T?
Response data.
getter/setter pair
errors APIError?
Response errors.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cast<R>() APIResponse<R>
Type cast for data
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