getExternalStoragePublicDirectory static method

Future<String?> getExternalStoragePublicDirectory(
  1. _DirType type
)

Equivalent to android's Environment.getExternalStoragePublicDirectory(type).getPath(). Return top-level external storage directory for placing files of a particular type example:

final downloadPath = await AndroidExternalStorage.getExternalStoragePublicDirectory(
            DirType.downloadDirectory,
);

Implementation

static Future<String?> getExternalStoragePublicDirectory(
    _DirType type) async {
  if (!Platform.isAndroid) throw UnsupportedError("Only Works in Android");
  return await _channel
      .invokeMethod(_getExPublicDirectory, {"type": type.type});
}