SmartRequest<T> constructor
const
SmartRequest<T> ({
- required String path,
- HttpMethod? method,
- dynamic data,
- Map<
String, dynamic> ? queryParameters, - Map<
String, String> ? headers, - Duration? timeout,
- CancelToken? cancelToken,
- bool isFormData = false,
- JsonDecoder<
T> ? fromJson, - BytesDecoder<
T> ? fromBytes, - RawResponseDecoder<
T> ? fromResponse, - List<
SmartPlugin> ? extraPlugins, - Set<
Type> ? excludePlugins, - Map<
Type, Set< ? skipHooks,LifecycleHook> > - Set<
String> ? consumedErrorCodes, - BaseOptions? optionsOverride,
- CacheOptions? cacheOptions,
- OnStart? onStart,
- OnSuccess<
T> ? onSuccess, - OnError? onError,
- OnFinish<
T> ? onFinish, - ErrorMessageBuilder? errorMessageBuilder,
- String? successMessage,
- 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,
});