ResponseResultsModel<T> class
A generic model that holds the parsed data from an API call and detailed Dio response info.
Constructors
- ResponseResultsModel({T? dataFromApi, required DioResultsModel dioDetails})
-
const
- ResponseResultsModel.fromDioError(DioException dioError)
-
Creates an instance from a Dio error response.
factory
- ResponseResultsModel.fromDioResponseData(Response dioResponse, T fromJsonT(dynamic)?)
-
Creates an instance from a successful Dio response.
Optionally applies a transformation function
fromJsonTto parse the data.factory
Properties
- dataFromApi → T?
-
The actual parsed data returned from the API, can be any type.
final
- dioDetails → DioResultsModel
-
Detailed metadata and diagnostics from the Dio request/response.
final
- duration → Duration?
-
Total duration of the request/response cycle.
no setter
- errorType → String
-
Returns a readable description of the error type, if any.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Indicates if the request resulted in an error.
no setter
- isSuccess → bool
-
Indicates if the request was successful (2xx status code).
no setter
- message → String
-
Returns the status message from the response.
no setter
- 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