android_external_storage 0.1.0
android_external_storage: ^0.1.0 copied to clipboard

android_external_storage is minimal flutter plugin for accessing android's external/shared storage path.

android_external_storage #

android_external_storage is minimal flutter plugin for accessing android's external/shared storage path. This plugin is based on https://pub.dev/packages/ext_storage plugin.

Features #

NOTE This plugin only support Android.

AndroidExternalStorage package calls Android native code.

AndroidExternalStorageAndroid Native
AndroidExternalStorage.getExternalStorageDirectory()Environment.getExternalStorageDirectory()
AndroidExternalStorage.getExternalStoragePublicDirectory()Environment.getExternalStoragePublicDirectory()
AndroidExternalStorage.getRootDirectory()Environment.getRootDirectory()

AndroidExternalStorage.getExternalStoragePublicDirectory() needs Public Directory Type argument same as native getExternalStoragePublicDirectory().

DirTypeAndroid Native
DirType.musicDirectoryEnvironment.DIRECTORY_MUSIC
DirType.podcastDirectoryEnvironment.DIRECTORY_PODCASTS
DirType.ringtoneDirectoryEnvironment.DIRECTORY_RINGTONES
DirType.alarmDirectoryEnvironment.DIRECTORY_ALARMS
DirType.notificationsDirectoryEnvironment.DIRECTORY_NOTIFICATIONS
DirType.picturesDirectoryEnvironment.DIRECTORY_PICTURES
DirType.moviesDirectoryEnvironment.DIRECTORY_MOVIES
DirType.downloadDirectoryEnvironment.DIRECTORY_DOWNLOADS
DirType.DCIMDirectoryEnvironment.DIRECTORY_DCIM
DirType.documentsDirectoryEnvironment.DIRECTORY_DOCUMENTS
DirType.screenshotsDirectoryEnvironment.DIRECTORY_SCREENSHOTS
DirType.audioBooksDirectoryEnvironment.DIRECTORY_AUDIOBOOKS

Example #

void _example1() async {
  var path = await AndroidExternalStorage.getExternalStorageDirectory();
  print(path);  // /storage/emulated/0
}

void _example2() async {
  var path = await AndroidExternalStorage.getExternalStoragePublicDirectory(DirType.picturesDirectory);
  print(path);  // /storage/emulated/0/Pictures
}

void _example3()async{
  var path = await AndroidExternalStorage.getRootDirectory();
  print(path);  // /system
}

Author #

sam garg

LICENCE #

MIT LICENCE

Based on https://pub.dev/packages/ext_storage.

0
likes
110
pub points
64%
popularity

Publisher

Unknown

android_external_storage is minimal flutter plugin for accessing android's external/shared storage path.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on android_external_storage