dirPath method

Future<Directory> dirPath()

Implementation

Future<Directory> dirPath() async {
  if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) return (await getDownloadsDirectory())!;
  if (Platform.isAndroid) {
    Directory directory = Directory(await androidDirPath());
    return !await directory.exists() ? (await getExternalStorageDirectory())! : directory;
  }
  if (Platform.isIOS) return await getApplicationDocumentsDirectory();
  return await getApplicationDocumentsDirectory();
}