'How can I show the user the file that he just downloaded?

I used Dio to download a file as following:

final dio = Dio();
final Directory appStorageDirectory = await getExternalStorageDirectory();
await dio.download(
    url,
     "${appStorageDirectory.path}/file.pdf",
 );

Works and the pdf file is at:

/storage/emulated/0/Android/data/com.my.app/files

But currently nothing happens that indicates a (successful/failed) download. I could alert some notification in the app that it was successful but I am used to something like a push notification that something was downloaded and clicking on that notification opens the file with whatever PDF reader of the device. How is this possible with flutter? Or 'at least' open it immediately when the download is finished?

Also that path is not easy to access for a user. Is it possible to save it in the more visible Downloads or Documents folder? path_provider does not seem to have a function for that so I assume it is not trivial to do for both android and iOS?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source