NetworkRequest constructor
NetworkRequest({
- required dynamic api,
- dynamic data,
- bool callDefaults = true,
- dynamic timeOut = const Duration(seconds: 30),
- bool handleErrors = true,
- bool handleSuccess = true,
- dynamic retry(
- bool force,
- NetworkResponse response
- void onReceiveProgress()?,
- String? savePath,
- String compressDataKey = "Body",
- bool useCompression = false,
Implementation
factory NetworkRequest({
required api,
data,
bool callDefaults = true,
timeOut = const Duration(seconds: 30),
bool handleErrors = true,
bool handleSuccess = true,
dynamic Function(bool force,NetworkResponse response)? retry,
void Function(int, int)? onReceiveProgress,
String? savePath,
String compressDataKey = "Body",
bool useCompression = false,
}) {
NetworkOption option = NetworkOption();
return NetworkRequest._(
api: api,
data: data,
timeOut: timeOut,
useCompression: useCompression,
compressDataKey: compressDataKey,
options: option,
callDefaults: callDefaults,
handleErrors: handleErrors,
handleSuccess: handleSuccess,
retry: retry,
onReceiveProgress: onReceiveProgress,
savePath: savePath,
);
}