downloadAndOpen method
Downloads a file from the given URL and opens it with the default application.
The behavior differs by platform:
- On mobile/desktop: Downloads the file to a temporary directory and opens it
- On web: Triggers a browser download of the file
Parameters:
url: The URL of the file to downloadfilename: The name to use for the downloaded file
Throws:
- May throw exceptions if the download fails or the file cannot be opened.
Implementation
Future<void> downloadAndOpen(String url, String filename) async {
await platform.downloadAndOpenFile(url, filename);
}