Save flutter files in location accessable from the android files app

Issue

I want to save audio files in my flutter app, but in addition to them being available inside the app, I also want to access them from the android files app. Is there a location that can be accessed from both?

I have tried saving the files to the downloads directory, but I am only able to find folders, not the files in that folder using the flutter IO package:

io.Directory("/storage/emulated/0/Download/").listSync() 

Is there another location I can use, or another code snippet I can use to get files from both flutter and the files app?

Solution

Add permission in Android Manifest:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGEā€/>

Answered By – Muhammad Faiq

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *