RequestResponse<T> class

A class to encapsulate the response from the backend used across the package

Constructors

RequestResponse(int? httpCode, bool isSuccess, T data, {RenovationError? exc, ErrorDetail? error, Response<String>? rawResponse})

Properties

data ↔ T
The data coming from the response or otherwise
getter/setter pair
error ↔ ErrorDetail?
getter/setter pair
exc RenovationError?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
httpCode int?
The HTTP status code
getter/setter pair
isSuccess bool
Whether the request is successful
getter/setter pair
rawResponse ↔ Response<String>?
The raw response object of the dio package
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

fail<F>(ErrorDetail errorDetail) RequestResponse<F?>
Returns a RequestResponse instance with the error details ErrorDetail if any
success<F>(F data, {int? httpCode, Response<String>? rawResponse}) RequestResponse<F>
Returns a success RequestResponse instance