SmartRequest<T> constructor

const SmartRequest<T>({
  1. required String path,
  2. HttpMethod? method,
  3. dynamic data,
  4. Map<String, dynamic>? queryParameters,
  5. Map<String, String>? headers,
  6. Duration? timeout,
  7. CancelToken? cancelToken,
  8. bool isFormData = false,
  9. JsonDecoder<T>? fromJson,
  10. BytesDecoder<T>? fromBytes,
  11. RawResponseDecoder<T>? fromResponse,
  12. List<SmartPlugin>? extraPlugins,
  13. Set<Type>? excludePlugins,
  14. Map<Type, Set<LifecycleHook>>? skipHooks,
  15. Set<String>? consumedErrorCodes,
  16. BaseOptions? optionsOverride,
  17. CacheOptions? cacheOptions,
  18. OnStart? onStart,
  19. OnSuccess<T>? onSuccess,
  20. OnError? onError,
  21. OnFinish<T>? onFinish,
  22. ErrorMessageBuilder? errorMessageBuilder,
  23. String? successMessage,
  24. SuccessMessageBuilder<T>? successMessageBuilder,
})

Implementation

const SmartRequest({
  required this.path,
  this.method,
  this.data,
  this.queryParameters,
  this.headers,
  this.timeout,
  this.cancelToken,
  this.isFormData = false,
  this.fromJson,
  this.fromBytes,
  this.fromResponse,
  // 新增参数
  this.extraPlugins,
  this.excludePlugins,
  this.skipHooks,
  this.consumedErrorCodes,
  this.optionsOverride,
  this.cacheOptions,
  this.onStart,
  this.onSuccess,
  this.onError,
  this.onFinish,
  this.errorMessageBuilder,
  this.successMessage,
  this.successMessageBuilder,
});