ext_storage 1.0.3

Flutter Android iOS

ext_storage is minimal flutter plugin that provides external storage path and external public storage path.

ext_storage #

ext_storage is minimal flutter plugin that provides external storage path and external public storage path.

Features #

NOTE This plugin is only supported Android.

ExtStorage package calls Android native code, Environment.getExternalStorageDirectory() and Environment.getExternalStoragePublicDirectory().

ExtStorageAndorid Native
ExtStorage.getExternalStorageDirectory()Environment.getExternalStorageDirectory()
ExtStorage.getExternalStoragePublicDirectory()Environment.getExternalStoragePublicDirectory()

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

ExtStorageAndroid Native
ExtStorage.DIRECTORY_MUSICEnvironment.DIRECTORY_MUSIC
ExtStorage.DIRECTORY_PODCASTSEnvironment.DIRECTORY_PODCASTS
ExtStorage.DIRECTORY_RINGTONESEnvironment.DIRECTORY_RINGTONES
ExtStorage.DIRECTORY_ALARMSEnvironment.DIRECTORY_ALARMS
ExtStorage.DIRECTORY_NOTIFICATIONSEnvironment.DIRECTORY_NOTIFICATIONS
ExtStorage.DIRECTORY_PICTURESEnvironment.DIRECTORY_PICTURES
ExtStorage.DIRECTORY_MOVIESEnvironment.DIRECTORY_MOVIES
ExtStorage.DIRECTORY_DOWNLOADSEnvironment.DIRECTORY_DOWNLOADS
ExtStorage.DIRECTORY_DCIMEnvironment.DIRECTORY_DCIM
ExtStorage.DIRECTORY_DOCUMENTSEnvironment.DIRECTORY_DOCUMENTS
ExtStorage.DIRECTORY_SCREENSHOTSEnvironment.DIRECTORY_SCREENSHOTS
ExtStorage.DIRECTORY_AUDIOBOOKSEnvironment.DIRECTORY_AUDIOBOOKS

Installation #

Add ext_storage as a dipendency in your project pubspeck.yaml.

dependencies:
  ext_storage:

and run the flutter pub get to install.

Usage #

First, you write import ext_storage package.

import 'package:ext_storage/ext_storage.dart';

And you can call two functions.

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

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

Author #

yasukotelin

LICENCE #

MIT LICENCE

24
likes
80
pub points
93%
popularity

ext_storage is minimal flutter plugin that provides external storage path and external public storage path.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

yasukotelin@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on ext_storage