BasicDioOptions constructor

BasicDioOptions({
  1. Duration? receiveTimeout = const Duration(seconds: 5),
  2. Duration? connectTimeout = const Duration(seconds: 5),
  3. Duration? sendTimeout = const Duration(seconds: 5),
  4. ResponseType 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. String? method,
  15. String baseUrl = '',
  16. Map<String, dynamic>? queryParameters,
  17. Map<String, dynamic>? extra,
  18. Map<String, dynamic>? headers,
  19. ResponseType? responseType = ResponseType.json,
  20. String? contentType,
  21. ValidateStatus? validateStatus,
  22. bool? receiveDataWhenStatusError,
  23. bool? followRedirects,
  24. int? maxRedirects,
  25. RequestEncoder? requestEncoder,
  26. ResponseDecoder? responseDecoder,
  27. ListFormat? 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;
}