How can I use path_provider to download files from bytes in external storage, like download folder, like you try to make it get the application directory, writing it and moving to external storage, but it doesn't give me error and it don't make the download.
This is how I done the download to application storage:
var tempDir = await getApplicationDocumentsDirectory();
var tempPath = tempDir.path;
var tempFile = File('$tempPath/${solicitacao.id}.pdf');
tempFile.writeAsBytesSync(solicitacao.matriculapdf);
if (selectedPdfs.any((file) => file.path == tempFile.path)) {
selectedPdfs.remove(tempFile);
} else {
selectedPdfs.add(tempFile);
}
User Permission Handler package for permission.
first set the permissions right in your Android Manifest
This will work in both Android and IOS.
Now save file into this folder
Answer Reference