NetworkRequest constructor

NetworkRequest({
  1. required dynamic api,
  2. dynamic data,
  3. bool callDefaults = true,
  4. dynamic timeOut = const Duration(seconds: 30),
  5. bool handleErrors = true,
  6. bool handleSuccess = true,
  7. dynamic retry(
    1. bool force,
    2. NetworkResponse response
    )?,
  8. void onReceiveProgress(
    1. int,
    2. int
    )?,
  9. String? savePath,
  10. String compressDataKey = "Body",
  11. 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,
  );
}