ResponseModel<T> class

Inheritance

Constructors

ResponseModel({String? type, T? data, Response? response, int? statusCode, String? statusMessage, Headers? headers, required RequestOptions requestOptions, List<RedirectRecord> redirects = const [], Map<String, dynamic>? extra, BaseOptions? baseOptions, dynamic error})

Properties

baseOptions BaseOptions?
getter/setter pair
保存的cookie
getter/setter pair
data ↔ T?
The response payload in specific type.
getter/setter pairinherited
error ↔ dynamic
error 信息
getter/setter pair
extra Map<String, dynamic>
An extra map that you can save your custom information in.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
headers Headers
Headers for the response.
getter/setter pairinherited
isRedirect bool
Whether the response has been redirected.
getter/setter pairinherited
realUri Uri
Return the final real request URI (may be redirected).
no setterinherited
redirects List<RedirectRecord>
All redirections happened before the response respond.
getter/setter pairinherited
requestOptions RequestOptions
The RequestOptions used for the corresponding request.
getter/setter pairinherited
response Response?
dio response
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int?
The HTTP status code for the response.
getter/setter pairinherited
statusMessage String?
Returns the reason phrase associated with the status code.
getter/setter pairinherited
type String?
请求返回类型 DioErrorType.toString
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestOptionsToMap() Map<String, dynamic>
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

constResponseModel<T>({dynamic error}) ResponseModel<T>
formResponse<T>(Response<T> response, {DioErrorType? type, BaseOptions? baseOptions}) ResponseModel<T>
mergeError<T>(DioError err, [ResponseModel<T>? responseModel]) ResponseModel<T>