downloadFile function
Implementation
Future<void> downloadFile(String url) async {
try {
print("Download or Share File: $url");
final filePath = await download(url);
await OpenFilex.open(filePath);
} catch (e) {
throw Exception('Error fetching file: $e');
}
}