download method

Future<String> download(
  1. int documentId,
  2. int fileId, {
  3. dynamic progress(
    1. int,
    2. int
    )?,
})

Implementation

Future<String> download(int documentId, int fileId,
    {Function(int, int)? progress}) async {
  final tempDir = await getTemporaryDirectory();
  final fullPath = "${tempDir.path}/$fileId";
  await dio.download('/attachments/$documentId/$fileId', fullPath,
      onReceiveProgress: progress, queryParameters: {});
  return fullPath;
}