You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,31 @@ Major release focused on support for `Storage Access Framework`.
4
4
5
5
### Breaking Changes
6
6
7
-
- New `minSdkVersion` set to `19`.
8
-
-`getMediaStoreContentDirectory` return type set to `Uri`.
7
+
-`minSdkVersion` set to `19`.
8
+
-`getMediaStoreContentDirectory` return type changed to `Uri`.
9
+
- Import package directive path is now modular. Which means you need to import the modules you are using:
10
+
-`import 'package:shared_storage/saf.dart' as saf;` to enable **Storage Access Framework** API.
11
+
-`import 'package:shared_storage/environment.dart' as environment;` to enable **Environment** API.
12
+
-`import 'package:shared_storage/media_store.dart' as mediastore;` to enable **Media Store** API.
13
+
-`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).
14
+
15
+
### New Features
16
+
17
+
- <samp>Mirror</samp> `createFile` from [DocumentFile.createFile()](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#createFile(java.lang.String,%20java.lang.String)>). Create a child file from given a parent uri.
18
+
19
+
- <samp>Mirror</samp> `child` from [DocumentFile.child()](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#createFile(java.lang.String,%20java.lang.String)>). Find the child file of a given parent uri and child name, null if doesn't exists.
20
+
21
+
- <samp>Original `UNSTABLE`</samp> `openDocumentFile`. Open a file uri in a external app, by starting a new activity with `ACTION_VIEW` Intent.
22
+
23
+
- <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.
24
+
25
+
- <samp>Alias</samp> `getDocumentContentAsString`. Alias for `getDocumentContent` and convert all bytes into `String`.
26
+
27
+
-
9
28
10
29
### Deprecation Notices
11
30
12
-
-`getExternalStoragePublicDirectory` was marked as deprecated and should be replaced with an equivalent API depending on your use-case, see [how to migrate `getExternalStoragePublicDirectory`](https://stackoverflow.com/questions/56468539/getexternalstoragepublicdirectory-deprecated-in-android-q).
31
+
-`getExternalStoragePublicDirectory` was marked as deprecated and should be replaced with an equivalent API depending on your use-case, see [how to migrate `getExternalStoragePublicDirectory`](https://stackoverflow.com/questions/56468539/getexternalstoragepublicdirectory-deprecated-in-android-q). This deprecation is originated from official Android documentation and not by the plugin itself.
Copy file name to clipboardExpand all lines: docs/Usage/Storage Access Framework.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,19 @@ final Stream<PartialDocumentFile> onNewFileLoaded = documentFileOfMyGrantedUri.l
90
90
onNewFileLoaded.listen((file) => files.add(file), onDone: () => print('All files were loaded'));
91
91
```
92
92
93
+
### <samp>getRealPathFromUri</samp>
94
+
95
+
Helper method to generate the file path of the given `uri`.
96
+
97
+
See [Get real path from URI, Android KitKat new storage access framework](https://stackoverflow.com/questions/20067508/get-real-path-from-uri-android-kitkat-new-storage-access-framework/20559175#20559175) for details.
98
+
99
+
```dart
100
+
/// Any valid Uri.
101
+
final Uri myUri = ...;
102
+
103
+
final String? file = await getRealPathFromUri(myUri);
104
+
```
105
+
93
106
## Mirror methods
94
107
95
108
Mirror methods are available to provide an way to call a native method without using any abstraction, available mirror methods:
0 commit comments