downloadAndOpenFile function

Future<void> downloadAndOpenFile(
  1. String url,
  2. String filename
)

Implementation

Future<void> downloadAndOpenFile(String url, String filename) async {
  final savedPath = await getTemporaryDirectory();
  final ioFile = await _repository.downloadFile(
    url: url,
    savePath: savedPath.path,
    filename: filename,
  );

  if (ioFile != null) {
    OpenFile.open(ioFile.path);
  }
}