Search code examples
flutterdartstorageandroid-permissionsandroid-external-storage

How can I save files on android 13 (API 33) by using Flutter (Dart)


Files are not only media files. It may also be .pdf, .zip, .xls and etc..

The external storage permission is permanently denied on API 33.
So, we are not able to save like this method ->

String path = 'This is external storage path';
File(path).writeAsBytes(bytes) 

My app is working well on android 11, 10, 9 and etc.. I have set storage permissions on AndroidManifest.xml but it is not work on android 13.
So, How can I save files at external storage on android 13?
I know a way to set MANAGE_EXTERNAL_STORAGE on AndroidManifest.xml. But it is restricted by PlayStore. So, it doesn't ok for us.

So, What is the best way to save files on Android 13's external storage?

I have seen this discussion.


Solution

  • I found a package to solve this case.
    This way is very easy and working fine.
    So, I set this package as the best solution for now.
    If anyone have a better way, I will define it as answer.