BasicDioOptions constructor
BasicDioOptions({
- dynamic receiveTimeout = const Duration(seconds: 5),
- dynamic connectTimeout = const Duration(seconds: 5),
- dynamic sendTimeout = const Duration(seconds: 5),
- dynamic downloadResponseType = ResponseType.bytes,
- String? downloadContentType,
- String? uploadContentType,
- ValueCallbackHeader? extraHeader,
- ValueCallbackData? extraData,
- ValueCallbackUriData? extraUriData,
- ValueCallbackParams? extraParams,
- ValueCallbackUri? extraUri,
- BasicDioErrorIntercept? errorIntercept,
- List<
String> filteredApi = const [], - dynamic method,
- dynamic baseUrl = '',
- dynamic queryParameters,
- dynamic extra,
- dynamic headers,
- dynamic responseType = ResponseType.json,
- dynamic contentType,
- dynamic validateStatus,
- dynamic receiveDataWhenStatusError,
- dynamic followRedirects,
- dynamic maxRedirects,
- dynamic requestEncoder,
- dynamic responseDecoder,
- dynamic 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,
Implementation
BasicDioOptions({
/// 接收超时时间
super.receiveTimeout = const Duration(seconds: 5),
/// 连接超时时间
super.connectTimeout = const Duration(seconds: 5),
/// 发送超时时间
super.sendTimeout = const Duration(seconds: 5),
this.downloadResponseType = ResponseType.bytes,
this.downloadContentType,
this.uploadContentType,
this.extraHeader,
this.extraData,
this.extraUriData,
this.extraParams,
this.extraUri,
this.errorIntercept,
this.filteredApi = const [],
super.method,
super.baseUrl = '',
super.queryParameters,
super.extra,
super.headers,
super.responseType = ResponseType.json,
super.contentType,
super.validateStatus,
super.receiveDataWhenStatusError,
super.followRedirects,
super.maxRedirects,
super.requestEncoder,
super.responseDecoder,
super.listFormat,
this.codeKeys = const ['code', 'status', 'statusCode', 'errcode'],
this.msgKeys = const ['msg', 'errorMessage', 'statusMessage', 'errmsg'],
this.dataKeys = const ['data', 'result'],
this.extensionKeys = const ['extension'],
this.hideMsg = const ['success', 'OK'],
this.successCode = const ['200'],
this.showLoading = true,
this.pullHideLoading = true,
}) {
downloadContentType ??= kContentTypeWithFormData;
uploadContentType ??= kContentTypeWithFormData;
}