BasicDioOptions constructor

BasicDioOptions({
  1. dynamic receiveTimeout = const Duration(seconds: 5),
  2. dynamic connectTimeout = const Duration(seconds: 5),
  3. dynamic sendTimeout = const Duration(seconds: 5),
  4. dynamic downloadResponseType = ResponseType.bytes,
  5. String? downloadContentType,
  6. String? uploadContentType,
  7. ValueCallbackHeader? extraHeader,
  8. ValueCallbackData? extraData,
  9. ValueCallbackUriData? extraUriData,
  10. ValueCallbackParams? extraParams,
  11. ValueCallbackUri? extraUri,
  12. BasicDioErrorIntercept? errorIntercept,
  13. List<String> filteredApi = const [],
  14. dynamic method,
  15. dynamic baseUrl = '',
  16. dynamic queryParameters,
  17. dynamic extra,
  18. dynamic headers,
  19. dynamic responseType = ResponseType.json,
  20. dynamic contentType,
  21. dynamic validateStatus,
  22. dynamic receiveDataWhenStatusError,
  23. dynamic followRedirects,
  24. dynamic maxRedirects,
  25. dynamic requestEncoder,
  26. dynamic responseDecoder,
  27. dynamic listFormat,
  28. List<String> codeKeys = const ['code', 'status', 'statusCode', 'errcode'],
  29. List<String> msgKeys = const ['msg', 'errorMessage', 'statusMessage', 'errmsg'],
  30. List<String> dataKeys = const ['data', 'result'],
  31. List<String> extensionKeys = const ['extension'],
  32. List<String> hideMsg = const ['success', 'OK'],
  33. List<String> successCode = const ['200'],
  34. bool showLoading = true,
  35. 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;
}