BaseApi<T> class abstract

Inheritance
Mixed-in types
Implementers

Constructors

BaseApi({String path = '', dynamic param, Map<String, dynamic>? queryParameters, bool isDebug = true, Options? opt, String method = 'POST', Duration? sendTimeout, Duration? receiveTimeout, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat, bool showToast = true, bool showLoading = true, bool encrypt = false, TransformJson<T>? serializer})

Properties

canShowLoading bool
getter/setter pairinherited
canShowToast bool
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>?
request header
getter/setter pair
isDebug bool
getter/setter pair
isEncrypt bool
getter/setter pairinherited
loadingMsg String
getter/setter pairinherited
opt Options
请求配置
getter/setter pair
param ↔ dynamic
request body for post/put/...
getter/setter pair
path String
request path
getter/setter pair
queryParameters Map<String, dynamic>?
request param for get
getter/setter pair
result BaseModel<T>
BaseModel witch is tramsfrom by response data
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializer TransformJson<T>?
根据 BaseModel.result 内省结果, 完成相应的模型转换
getter/setter pair

Methods

custom() Future<Response>
decryptedAes(dynamic data) → dynamic
inherited
dimiss() → void
inherited
dispatch() Future<BaseModel<T>>
约定: dispatch().then 代表 网络&业务逻辑 都是成功
encrypt(RequestOptions options) → dynamic
inherited
networkError(DioException error) → void
网络错误处理
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onResponseError(BaseModel res) → void
服务端返回错误
inherited
requestBaseUrl() String
请求地址
inherited
requestHeader() Map<String, dynamic>
请求头
inherited
serializerJson() → void
模型解析
showLoading() → void
inherited
showToast({String msg = '加载失败'}) → void
inherited
toString() String
A string representation of this object.
inherited
transformModelFromResponseData<T>(Map responseData) BaseModel<T>
解析请求结果
inherited

Operators

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