'How to get Downloads path in Flutter?
I am using the below code to get the path to Downloads folder:
final output = await getExternalStorageDirectory();
RegExp pathToDownloads = new RegExp(r'.+0\/');
final outputPath = '${pathToDownloads.stringMatch(output.path).toString()}Downloads';
The above code generates this string:
/storage/emulated/0/Downloads
But console says "No such file or directory". I created this path string because some answers on stack overflow mention that the above is the location of the downloads folder but it isn't. So what is the path to downloads folder on android and how to get access to it?
Solution 1:[1]
You can get download path without any package. Try that:
Directory dir = Directory('/storage/emulated/0/Download');
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aaydin |
