copyFileToDownloads static method
Implementation
static Future<void> copyFileToDownloads(
String sourcePath,
String fileName,
) async {
final downloadsDir = Directory('/storage/emulated/0/Download');
if (!await downloadsDir.exists()) {
throw Exception('Downloads folder not found.');
}
final destinationPath = '${downloadsDir.path}/$fileName';
await copyFile(sourcePath, destinationPath);
}