download method

Future download(
  1. String path,
  2. String savePath, {
  3. void receiveCallback(
    1. int,
    2. int
    )?,
  4. Map<String, dynamic>? data,
  5. Options? options,
  6. HandleError? showError,
})

Implementation

Future<dynamic> download(
  String path,
  String savePath, {
  void Function(int, int)? receiveCallback,
  Map<String, dynamic>? data,
  Options? options,
  HandleError? showError,
}) async {
  return await _do(() async {
    var dio = dioUpload();
    return await dio.download(
      path,
      savePath,
      data: data,
      options: options,
      onReceiveProgress: (int receive, int total) {
        if (receiveCallback != null) {
          receiveCallback(receive, total);
        }
      },
    );
  }, showError);
}