shared_storage 0.1.0 copy "shared_storage: ^0.1.0" to clipboard
shared_storage: ^0.1.0 copied to clipboard

discontinued
outdated

Flutter plugin to get internal and external public directory path.

Shared Storage Flutter Plugin #

pub package

Plugin to fetch Android shared storage/folders info

Notes #

  • Android Only
  • Alpha version
  • Supports Android 4.1+ (API Level 16+)

Features #

This plugin allow us to get path of top-level shared folder (Downloads, DCIM, Videos, Audio) using the following Android API's

/// Get Android [downloads] top-level shared folder
/// You can also create a reference to a custom directory as: `EnvironmentDirectory.custom('Custom Folder')`
final sharedDirectory = 
    await getExternalStoragePublicDirectory(EnvironmentDirectory.downloads); 

print(sharedDirectory.path); /// `/storage/emulated/0/Download`
/// Get Android [downloads] shared folder for Android 9+
final sharedDirectory = 
    await getMediaStoreContentDirectory(MediaStoreCollection.downloads);

print(sharedDirectory.path); /// `/external/downloads`
  • Get root Android path, note that is a read-only folder
/// Get Android root folder
final sharedDirectory = await getRootDirectory();

print(sharedDirectory.path); /// `/system`

Android API's #

Most Flutter plugins uses Android API's under the hood. So this plugin do the same, and to retrieve Android shared folder paths the following API's are being used:

🔗 android.os.Environment 🔗 android.provider.MediaStore


Open Source

Copyright © 2021-present, Laks Castro.

Shared Storage is MIT licensed 💖

59
likes
0
pub points
95%
popularity

Publisher

verified publisheralexrintt.io

Flutter plugin to get internal and external public directory path.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on shared_storage