getDownloadFileLocation function

Future<File> getDownloadFileLocation(
  1. String release,
  2. String appName,
  3. String extension
)

Implementation

Future<File> getDownloadFileLocation(
    String release, String appName, String extension) async {
  final downloadDir = await getDownloadsDirectory();
  if (downloadDir == null) {
    throw Exception('Unable to get downloads directory');
  }
  final filePath = p.join(
    downloadDir.absolute.path,
    '$appName-$release.$extension',
  );
  return File(filePath);
}