APIConfig constructor

APIConfig({
  1. Dio? dio,
  2. String? baseUrl,
  3. Duration? connectTimeout = const Duration(seconds: 60),
  4. String? contentType,
  5. bool ensureNonNullHeadersFields = false,
  6. bool ensureNonNullParametersFields = false,
  7. Parameters? extra,
  8. bool? followRedirects,
  9. HTTPHeader? headers,
  10. bool isHandleErrors = false,
  11. ListFormat? listFormat,
  12. int? maxRedirects,
  13. HTTPMethod? method = HTTPMethod.GET,
  14. bool? persistentConnection,
  15. bool postBodyByDefault = false,
  16. BodyFormat? postBodyFormat,
  17. @Deprecated('Use `postBodyByDefault` and `postBodyFormat` instead, it will be removed in next version.') bool postUseFormData = false,
  18. String prefixPath = '',
  19. bool preserveHeaderCase = false,
  20. Parameters? queryParameters,
  21. bool? receiveDataWhenStatusError,
  22. Duration? receiveTimeout = const Duration(seconds: 60),
  23. RequestEncoder? requestEncoder,
  24. ResponseDecoder? responseDecoder,
  25. ResponseType? responseType = ResponseType.json,
  26. Duration? sendTimeout,
  27. String suffixPath = '',
  28. ValidateStatus? validateStatus,
})

Implementation

APIConfig({
  this.dio,
  this.baseUrl,
  this.connectTimeout = const Duration(seconds: 60),
  this.contentType,
  this.ensureNonNullHeadersFields = false,
  this.ensureNonNullParametersFields = false,
  this.extra,
  this.followRedirects,
  this.headers,
  this.isHandleErrors = false,
  // this.isToastErrors = false,
  this.listFormat,
  this.maxRedirects,
  this.method = HTTPMethod.GET,
  this.persistentConnection,
  this.postBodyByDefault = false,
  this.postBodyFormat,
  @Deprecated(
      'Use `postBodyByDefault` and `postBodyFormat` instead, it will be removed in next version.')
  this.postUseFormData = false,
  this.prefixPath = '',
  this.preserveHeaderCase = false,
  this.queryParameters,
  this.receiveDataWhenStatusError,
  this.receiveTimeout = const Duration(seconds: 60),
  this.requestEncoder,
  this.responseDecoder,
  this.responseType = ResponseType.json,
  this.sendTimeout,
  this.suffixPath = '',
  this.validateStatus,
});