getDownloadPath static method

Future<String?> getDownloadPath()

Implementation

static Future<String?> getDownloadPath() async {
  Directory? directory;
  if (Platform.isIOS) {
    directory = await getApplicationDocumentsDirectory();
  } else {
    directory = Directory('/storage/emulated/0/Download');
    if (!await directory.exists()) {
      directory = await getExternalStorageDirectory();
    }
  }
  return directory?.path;
}