Open BoHellgren opened 2 years ago
use ExternalPath.DIRECTORY_DCIM
and Then append /Screenshots to get correct screenshots directory
That is an obvious bypass and this is what I use
String dir1 = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_SCREENSHOTS);
String dir2 = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DCIM);
String dir3 = await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_PICTURES);
Directory downDir = Directory(dir1);
if (!downDir.existsSync()) {
downDir = Directory(dir2 + r'/Screenshots');
if (!downDir.existsSync()) {
downDir = Directory(dir3 + r'/Screenshots');
if (!downDir.existsSync()) {
return 'noDirectory';
}
}
This code should be in the extenal_path plugin. As it stands now, ExternalPath.DIRECTORY_SCREENSHOTS returns the wrong directory on several models, which I consider a bug.
ExternalPath.DIRECTORY_SCREENSHOTS gives me /storage/emulated/0/Screenshots but on my Samsung S10e the screenshots are in /storage/emulated/0/DCIM/Screenshots