BaseDioOptions class

Inheritance

Constructors

BaseDioOptions({Duration? receiveTimeout = const Duration(seconds: 5), Duration? connectTimeout = const Duration(seconds: 5), Duration? sendTimeout = const Duration(seconds: 5), ResponseType downloadResponseType = ResponseType.bytes, String? downloadContentType, String? uploadContentType, ValueCallbackHeader? extraHeader, ValueCallbackData? extraData, ValueCallbackUriData? extraUriData, ValueCallbackParams? extraParams, ValueCallbackUri? extraUri, BaseDioErrorIntercept? errorIntercept, String? method, String baseUrl = '', Map<String, dynamic>? queryParameters, Map<String, dynamic>? extra, Map<String, dynamic>? headers, ResponseType? responseType = ResponseType.json, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat, List<String> codeKeys = const ['code', 'status', 'statusCode', 'errcode'], List<String> msgKeys = const ['msg', 'errorMessage', 'statusMessage', 'errmsg'], List<String> dataKeys = const ['data', 'result'], List<String> extensionKeys = const ['extension'], List<String> hideMsg = const ['success', 'OK'], List<String> successCode = const ['200'], bool showLoading = true, bool pullHideLoading = true})

Properties

baseUrl String
Request base url, it can be multiple forms:
getter/setter pairinherited
codeKeys List<String>
BaseModel 后台返回状态码
getter/setter pair
connectTimeout Duration?
Timeout when opening a request.
getter/setter pairinherited
contentType String?
getter/setter pairinherited
dataKeys List<String>
BaseModel 后台返回具体数据
getter/setter pair
downloadContentType String?
下载的ContentType;
getter/setter pair
downloadResponseType ResponseType
下载文件时的请求类型
getter/setter pair
errorIntercept BaseDioErrorIntercept?
错误拦截;
getter/setter pair
extensionKeys List<String>
BaseModel 后台返回扩展数据
getter/setter pair
extra Map<String, dynamic>
getter/setter pairinherited
extraData ValueCallbackData?
扩展所有的 data 参数
getter/setter pair
extraHeader ValueCallbackHeader?
header设置
getter/setter pair
extraParams ValueCallbackParams?
扩展所有的 params
getter/setter pair
extraUri ValueCallbackUri?
扩展所有的 uri
getter/setter pair
extraUriData ValueCallbackUriData?
扩展所有的 uri Data
getter/setter pair
followRedirects bool
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>
getter/setter pairinherited
hideMsg List<String>
后台返回 message 隐藏 toast 主要用于 网络请求返回 判断方法resultSuccessFail
getter/setter pair
listFormat ListFormat
getter/setter pairinherited
maxRedirects int
getter/setter pairinherited
method String
getter/setter pairinherited
msgKeys List<String>
BaseModel 后台返回message
getter/setter pair
persistentConnection bool
getter/setter pairinherited
preserveHeaderCase bool
getter/setter pairinherited
pullHideLoading bool
showLoading 为 true 时 刷新组件 下拉或上拉 隐藏loading,默认为true
getter/setter pair
queryParameters Map<String, dynamic>
Common query parameters.
getter/setter pairinherited
receiveDataWhenStatusError bool
getter/setter pairinherited
receiveTimeout Duration?
getter/setter pairinherited
requestEncoder RequestEncoder?
getter/setter pairinherited
responseDecoder ResponseDecoder?
getter/setter pairinherited
responseType ResponseType
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration?
getter/setter pairinherited
showLoading bool
全局控制显示loading
getter/setter pair
successCode List<String>
后台返回成功的状态码 主要用于 网络请求返回 判断方法resultSuccessFail
getter/setter pair
uploadContentType String?
上传的Type
getter/setter pair
validateStatus ValidateStatus
getter/setter pairinherited

Methods

copyWith({String? method, String? baseUrl, Map<String, dynamic>? queryParameters, String? path, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, Map<String, Object?>? extra, Map<String, Object?>? headers, bool? preserveHeaderCase, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat}) BaseOptions
Create a BaseOptions from current instance with merged attributes.
inherited
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