Millie Hudson
Millie Hudson

Reputation: 85

Where to store downloaded files in a Flutter App?

Im learning Flutter and Im confused where the downloaded files are saved exactly?

For example Im building a mp3 player and Im required to download mp3 file from a URL but I have no idea where to save that mp3 file in case of downloading to iOS and in case of downloading to Android device.

Which is the safest location so that I dont screw up my app's performance?

I spent 2 days trying to figure out an answer for this question but I still dont understand it.

Please help :(

Upvotes: 0

Views: 1084

Answers (1)

ippi
ippi

Reputation: 10177

The docs (reading-writing-files ) uses path_provider. Have you checked it out?

The examples are fairly easy to understand: https://github.com/flutter/plugins/blob/master/packages/path_provider/path_provider/example/lib/main.dart

In your case I'd probably go with

getExternalStorageDirectories( StorageDirectory.music )

if available.

Upvotes: 2

Related Questions