NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev
Flutter plugin to work with external storage and privacy-friendly APIs.
Latest stable
0.8.1
Last release 3 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 14 of 14 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
15 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
Revert changes to Flutter SDK setup
Revert changes to Flutter SDK setup
New SAF API and Gradle version upgrade.
New SAF API and Gradle version upgrade.
openDocumentFileWithResult to allow implementation of success and error handling #121 (@mx1up).import 'package:shared_storage/shared_storage.dart';, all APIs were merged into a single import #126.openDocumentFile no longer throws exception, to handle it's result use openDocumentFileWithResult instead #126.getRealPathFromUri since it tries to go against the SAF API architecture (thus bring a lot of issues and is not safe across devices).renameTo sample usage in the example project #133.DocumentFileColumn it's now using the Dart enhanced enum syntax.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
No changes in the Dart API. It is just a hotfix in the Kotlin impl. See #118 for details.
There's no major breaking changes when updating to v0.7.0 but there are deprecation notices over Media Store and Environment API.
v0.7.0 but there are deprecation notices over Media Store and Environment API.openDocument API with single and multiple files support @honjow.openDocumentTree it now also supports persistablePermission option which flags an one-time operation to avoid unused permission issues.openDocument API.This release contains a severe API fixes and some minor doc changes:
This release contains a severe API fixes and some minor doc changes:
DocumentFile.getContent and DocumentFile.getContentAsString. #107.Rollup PR: github.com/alexrintt/shared-storage/pull/109.
New API to edit existing files.
This release contains:
To see details, refer to rollup PR #100.
writeToFile, writeToFileAsString and writeToFileAsBytes APIs to allow overwrite existing files by appending (FileMode.append) or truncating FileMode.write (@jfaltis).listFiles it's now returns a Stream<DocumentFile> instead of Stream<PartialDocumentFile>.DocumentFile.lastModified it's now returns a DateTime? instead of Future<DateTime?> (removed the asynchronous plugin call).DocumentFile class fields are now nullable except by DocumentFile.uri.createFile doesn't requires content or bytes anymore, it's now possible to just create the file reference without defining the file data, it'll be a empty String by default.DocumentFile.canRead it's now calling the right API (canRead) instead of the similar one (canWrite).getDocumentThumbnail API when thumbnail is not available.permission_handler plugin to request storage permission since it's already fully integrated with Storage Access Framework..apk image/*, video/*, text/plain and directories to make easier to see what is the type of the file while navigating between the folders.writeToFile API: Write to file (Overwrite file contents with a predefined string), Append to file (Append a predefined string to the end of the file), Ease file content (Self explanatory: erase it's data but do not delete the file) and Edit file content (Prompt the user with a text field to define the new file content), all buttons requires confirmation since it can cause data loss.Closes the OutputStream when creating a file #61, #86 (@jfaltis).
Minimal hotfix of the example project:
Minimal hotfix of the example project:
Fix the current behavior of listFiles and openDocumentFile API.
Fix the current behavior of listFiles and openDocumentFile API.
openDocumentTree (@EternityForest).ACTION_VIEW intent builder through openDocumentFile API was fixed. So it's now possible to open any file of any kind in third party apps without needing specify the mime type.DocumentFile.listFiles (Now it's only available globally).buildDocumentUriUsingTree removed due high coupling with Android API (Android specific API that are not useful on any other platforms).buildDocumentUri removed due high coupling with Android API (Android specific API that are not useful on any other platforms).buildTreeDocumentUri removed due high coupling with Android API (Android specific API that are not useful on any other platforms).getDocumentThumbnail now receives only the uri param instead of a rootUri and a documentId.rootUri field from QueryMetadata was removed due API ambiguity: there's no such concept in the Android API and this is not required by it to work well.Minor improvements and bug fixes:
Minor improvements and bug fixes:
DocumentFileColumn.id column on listFiles API. Thanks to @EternityForest.DocumentFileColumn.id column is optional when calling listFiles.…(API 29+) and though new, this API is marked as deprecated and should be migrated to a _scoped-storage_ approach.
Major release focused on support for Storage Access Framework.
minSdkVersion set to 19.getMediaStoreContentDirectory return type changed to Uri.import 'package:shared_storage/saf.dart' as saf; to enable Storage Access Framework API.import 'package:shared_storage/environment.dart' as environment; to enable Environment API.import 'package:shared_storage/media_store.dart' as mediastore; to enable Media Store API.import 'package:shared_storage/shared_storage' as sharedstorage; if you want to import all above and as a single module (Not recommended because can conflict/override names/methods).See the label reference here.
<samp>Original</samp> listFiles. This API does the same thing as DocumentFile.listFiles but through Android queries and not calling directly the DocumentFile.listFiles API for performance reasons.
<samp>Internal</samp> DocumentFile from DocumentFile SAF class.
<samp>Internal</samp> QueryMetadata metadata of the queries used by listFiles API.
<samp>Internal</samp> PartialDocumentFile. Represents a partial document file returned by listFiles API.
openDocumentTree now accepts grantWritePermission and initialUri params which, respectively, sets whether or not grant write permission level and the initial uri location of the folder authorization picker.
<samp>Mirror</samp> DocumentFileColumn from DocumentsContract.Document.<Column> SAF class.
<samp>Mirror</samp> canRead from DocumentFile.canRead. Returns true if the caller can read the given uri.
<samp>Mirror</samp> canWrite from DocumentFile.canWrite. Returns true if the caller can write to the given uri.
<samp>Mirror</samp> getDocumentThumbnail from DocumentsContract.getDocumentThumbnail. Returns the image thumbnail of a given uri, if any (e.g documents that can show a preview, like image or pdf, otherwise null).
<samp>Mirror</samp> exists from DocumentsContract.exists. Returns true if a given uri exists.
<samp>Mirror</samp> buildDocumentUriUsingTree from DocumentsContract.buildDocumentUriUsingTree.
<samp>Mirror</samp> buildDocumentUri from DocumentsContract.buildDocumentUri.
<samp>Mirror</samp> buildTreeDocumentUri from DocumentsContract.buildTreeDocumentUri.
<samp>Mirror</samp> delete from DocumentFile.delete. Self explanatory.
<samp>Mirror</samp> createDirectory from DocumentFile.createDirectory. Creates a new child document file that represents a directory given the displayName (folder name).
<samp>Alias</samp> createFile. Alias for createFileAsBytes or createFileAsString depending which params are provided.
<samp>Mirror</samp> createFileAsBytes from DocumentFile.createFile. Given the parent uri, creates a new child document file that represents a single file given the displayName, mimeType and its content in bytes (file name, file type and file content in raw bytes, respectively).
<samp>Alias</samp> createFileAsString. Alias for createFileAsBytes(bytes: Uint8List.fromList('file content...'.codeUnits)).
<samp>Mirror</samp> documentLength from DocumentFile.length. Returns the length of the given file (uri) in bytes. Returns 0 if the file does not exist, or if the length is unknown.
<samp>Mirror</samp> lastModified from DocumentFile.lastModified. Returns the time when the given file (uri) was last modified, measured in milliseconds since January 1st, 1970, midnight. Returns 0 if the file does not exist, or if the modified time is unknown.
<samp>Mirror</samp> findFile from DocumentFile.findFile. Search through listFiles() for the first document matching the given display name, this method has a really poor performance for large data sets, prefer using child instead.
<samp>Mirror</samp> fromTreeUri from DocumentFile.fromTreeUri.
<samp>Mirror</samp> renameTo from DocumentFile.renameTo. Rename a document file given its uri to the given displayName.
<samp>Mirror</samp> parentFile from DocumentFile.parentFile. Get the parent document of the given document file from its uri.
<samp>Mirror</samp> copy from DocumentsContract.copyDocument. Copies the given document to the given destination.
<samp>Original</samp> getDocumentContent. Read a document file from its uri by opening a input stream and returning its bytes.
<samp>External</samp> child from com.anggrayudi.storage.file.DocumentFile.child. Find the child file of a given parent uri and child name, null if doesn't exists (faster than findFile).
<samp>Original UNSTABLE</samp> openDocumentFile. Open a file uri in a external app, by starting a new activity with ACTION_VIEW Intent.
<samp>Original UNSTABLE</samp> getRealPathFromUri. Return the real path to work with native old File API instead Uris, be aware this approach is no longer supported on Android 10+ (API 29+) and though new, this API is marked as deprecated and should be migrated to a scoped-storage approach.
<samp>Alias</samp> getDocumentContentAsString. Alias for getDocumentContent. Convert all bytes returned by the original method into a String.
<samp>Internal</samp> DocumentBitmap class added. Commonly used as thumbnail image/bitmap of a DocumentFile.
<samp>Extension</samp> UriDocumentFileUtils on Uri (Accesible by uri.extensionMethod(...)).
toDocumentFile. Alias for DocumentFile.fromTreeUri(this) which is an alias for fromTreeUri. method: convert this to the respective DocumentFile (if exists, otherwise null).openDocumentFile. Alias for openDocumentFile.<samp>Mirror</samp> getDownloadCacheDirectory from Environment.getDataDirectory.
<samp>Mirror</samp> getStorageDirectory from Environment.getStorageDirectory.
getExternalStoragePublicDirectory was marked as deprecated and should be replaced with an equivalent API depending on your use-case, see how to migrate getExternalStoragePublicDirectory. This deprecation is originated from official Android documentation and not by the plugin itself.Add basic support for Storage Access Framework and targetSdk 31.
Add basic support for Storage Access Framework and targetSdk 31.
Storage Access Framework.build.gradle by targeting the current sdk to 31.Minor improvements on pub.dev documentation.
Minor improvements on pub.dev documentation.
example/ folder.pubspec.yaml properties.Initial release.
Initial release.
One column per quarter.