-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for Support of content://
URI in Flutter's File Class for Android
#54878
Comments
As I said in the referenced issue, this is likely a wontfix, since:
As to this:
That was not "the conclusion" it was a suggestion from another user for one possible solution. There are better options that don't involve For instance, there's been some discussion of reworking |
Correct
Good
inconclusion i should await the reworking ? |
just that there are no better if these feature is not available only ways are to render |
My initial thought is that this doesn't belong in From what @stuartmorgan wrote, that seems to not be the case - it uses the |
@brianquinlan nah doesn't use ContentProviderAPI its just like a normal path in android but instead of usual str /path/to/file its Uri instead Uri uri = Uri.parse("file:///path/to/your/file");
File file = new File(uri.getPath()); |
You've shown a |
@devfemibadmus In your example, does converting the |
Thats just an example
nah, Oh yeah It's ContentProviderAPI
You're right it uses ContentProvider API, but still since its lead to a file destination, should be called through |
It doesn't though, it resolved via an interprocess system-meditated data transfer. |
so what do we use? File? |
We should not use the The This is something else. It should be represented by something else. If the problem is that some existing code accepts only |
I think that using I'm closing this issue because I think that it is out-of-scope for Dart. If you disagree, please reopen with your reasoning. |
and using **In Dart, there is a built-in class called File which represents a file on the filesystem. ** final file = File(path);
// here path should be /Document/path/to/file/
So if you say this should be solved with flutter plugin, i will like you to expatiate maybe i can do that |
YES! YES!! PLEASE!!! |
Content Uri are now the standard way of accessing files in android. So, its frustrating that there is no direct support in Flutter/Dart for it. A third party plugin is not the best solution for this as it may or may not be maintained by the developer and may be buggy. |
finally someone is here for me |
I believe you can reopen the request. This requirement is a must have feature. |
you cannot re-open your own issues if a repo collaborator closed them @brianquinlan @stuartmorgan @lrhn |
Does sound like you want a That's not the Maybe the behavior is close enough to But it's not the |
Damn.............this gonna be another limitation for flutter even thou its android? |
I have opened a feature request on Flutter repository. flutter/flutter#147037 (comment) |
Use case
Request support for android
content:// uri
in the File class there is similar closed #25659. The conclusion of the #25659 is to use a plugin https://pub.dev/packages/flutter_absolute_path which i dont think that will be Good bcus this plugin copy the files temporary to another location then returns its absolute dir imagine working on large project where u work with many files, user will suffer for storage or sometimes not even enough storage to copy single fileand here #bug-flutter-fileimagevideo-not-working-with-android-action_open_document_tree-but-works-fine-in-kotlin
I convert the
content:// uri
to get stringabsolute path
but will end up in permission denied even thou permission been given successfully meaning converting doesn't work we can only access through content:// uri bcus we got that from https://developer.android.com/training/data-storage/shared/documents-filesthis issue is all derived from this simple flutter project https://github.com/devfemibadmus/whatsapp-status-saver
which we use https://developer.android.com/training/data-storage/shared/documents-files to get permission to folder, the code in android works fine bcus we can access content:// uri in adnroid but wont in flutter bcus
we can't access content:// uri in File
and with this, this simple flutter project is limited.Using manage_external_storage permission works fine but security issue app
reject from playstore
by the way not really recommended bcus of security please flutter request for feature Android support forcontent:// uri
in the File classProposal
Sample code
https://github.com/devfemibadmus/folderpermission
kotlin MainActivity.kt
Flutter main.dart
The text was updated successfully, but these errors were encountered: