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
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,25 +40,21 @@ See the label [reference here](/docs/Usage/API%20Labeling.md).
40
40
41
41
- <samp>Mirror</samp> `buildDocumentUri` from [`DocumentsContract.buildDocumentUri`](<https://developer.android.com/reference/android/provider/DocumentsContract#buildDocumentUri(java.lang.String,%20java.lang.String)>).
42
42
43
-
- <samp>Mirror</samp> `buildDocumentUri` from [`DocumentsContract.buildDocumentUri`](<https://developer.android.com/reference/android/provider/DocumentsContract#buildDocumentUri(java.lang.String,%20java.lang.String)>).
44
-
45
43
- <samp>Mirror</samp> `buildTreeDocumentUri` from [`DocumentsContract.buildTreeDocumentUri`](<https://developer.android.com/reference/android/provider/DocumentsContract#buildTreeDocumentUri(java.lang.String,%20java.lang.String)>).
46
44
47
-
- <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.
48
-
49
45
- <samp>Mirror</samp> `delete` from [`DocumentFile.delete`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#delete()>). Self explanatory.
50
46
51
47
- <samp>Mirror</samp> `createDirectory` from [`DocumentFile.createDirectory`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#createDirectory(java.lang.String)>). Creates a new child document file that represents a directory given the `displayName` (folder name).
52
48
53
-
- <samp>Mirror</samp> `createFile` from [`DocumentFile.createFile`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#createFile(java.lang.String,%20java.lang.String)>). Creates a new child document file that represents a single file given the `displayName` and the `mimeType` (file name and file type, respectively).
49
+
- <samp>Alias</samp> `createFile`. Alias for `createFileAsBytes` or `createFileAsString` depending which params are provided.
54
50
55
-
- <samp>Alias</samp> `createFileAsBytes`. Alias for `createFile(bytes: Uint8List.fromList('file content...'.codeUnits))`.
51
+
- <samp>Mirror</samp> `createFileAsBytes` from [`DocumentFile.createFile`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#createFile(java.lang.String,%20java.lang.String)>). 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).
56
52
57
-
- <samp>Alias</samp> `createFileAsString`. Alias for `createFile(content: 'file content...')`.
53
+
- <samp>Alias</samp> `createFileAsString`. Alias for `createFileAsBytes(bytes: Uint8List.fromList('file content...'.codeUnits))`.
58
54
59
-
- <samp>Mirror</samp> `documentLength` from [`DocumentFile.length`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#length()>). Returns the length of this file in bytes. Returns 0 if the file does not exist, or if the length is unknown.
55
+
- <samp>Mirror</samp> `documentLength` from [`DocumentFile.length`](<https://developer.android.com/reference/androidx/documentfile/provider/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.
60
56
61
-
- <samp>Mirror</samp> `lastModified` from [`DocumentFile.lastModified`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#lastModified()>). Returns the time when this file 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.
57
+
- <samp>Mirror</samp> `lastModified` from [`DocumentFile.lastModified`](<https://developer.android.com/reference/androidx/documentfile/provider/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.
62
58
63
59
- <samp>Mirror</samp> `findFile` from [`DocumentFile.findFile`](<https://developer.android.com/reference/androidx/documentfile/provider/DocumentFile#findFile(java.lang.String)>). 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.
64
60
@@ -72,8 +68,6 @@ See the label [reference here](/docs/Usage/API%20Labeling.md).
72
68
73
69
- <samp>Original</samp> `getDocumentContent`. Read a document file from its uri by opening a input stream and returning its bytes.
74
70
75
-
- <samp>Alias</samp> `getDocumentContentAsString`. Alias for `getDocumentContent` except this convert the bytes to `String`.
76
-
77
71
- <samp>External</samp> `child` from [`com.anggrayudi.storage.file.DocumentFile.child`](https://github.com/anggrayudi/SimpleStorage/blob/551fae55641dc58a9d3d99cb58fdf51c3d312b2d/storage/src/main/java/com/anggrayudi/storage/file/DocumentFileExt.kt#L270). Find the child file of a given parent uri and child name, null if doesn't exists (faster than `findFile`).
78
72
79
73
- <samp>Original `UNSTABLE`</samp> `openDocumentFile`. Open a file uri in a external app, by starting a new activity with `ACTION_VIEW` Intent.
@@ -87,8 +81,7 @@ See the label [reference here](/docs/Usage/API%20Labeling.md).
87
81
- <samp>Extension</samp> `UriDocumentFileUtils` on `Uri` (Accesible by `uri.extensionMethod(...)`).
88
82
89
83
- <samp>Alias</samp> `toDocumentFile`. Alias for `DocumentFile.fromTreeUri(this)` which is an alias for `fromTreeUri`. method: convert `this` to the respective `DocumentFile` (if exists, otherwise `null`).
90
-
- <samp>Alias</samp> `open`. Alias for `openDocumentFile`.
91
-
- <samp>Alias</samp> `openDocumentFile`. Alias for `openDocumentFile` (same of `open` alias with a more specific name).
84
+
- <samp>Alias</samp> `openDocumentFile`. Alias for `openDocumentFile`.
92
85
93
86
- <samp>Mirror</samp> `getDownloadCacheDirectory` from [`Environment.getDataDirectory`](https://developer.android.com/reference/android/os/Environment#getDownloadCacheDirectory%28%29).
Copy file name to clipboardExpand all lines: docs/Usage/API Labeling.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,11 @@ This package is intended to be a mirror of native Android APIs. Which means all
8
8
9
9
You are fully encouraged to understand/learn the native Android APIs to use this package. All packages (not only this one) are derivated from native APIs depending on the platform (Windows, iOS, Android, Unix, Web, etc.), to have a understing about it can help not only here but on all your Flutter journey, and even in other frameworks.
|**Internal**| New internal type (class). Usually they are only to keep a safe typing and are not usually intended to be instantiated for the package user. |
14
-
|**Original**| Original API which only exists inside this package and doesn't mirror any Android API (an abstraction). |
15
-
|**Mirror**| Pure mirror API (method/class) which was re-implemented in Dart from a native original API. |
16
-
|**External**| API from third-part Android libraries. |
|**Internal**| New internal type (class). Usually they are only to keep a safe typing and are not usually intended to be instantiated for the package user. |
14
+
|**Original**| Original API which only exists inside this package and doesn't mirror any Android API (an abstraction). |
15
+
|**Mirror**| Pure mirror API (method/class) which was re-implemented in Dart from a native original API. |
16
+
|**Alias**| Convenient methods. They do not implement anything new but create a new abstraction from an existing API. |
17
+
|**External**| API from third-part Android libraries. |
18
+
|**Extension**| These are most alias methods implemented through Dart extensions. |
0 commit comments