download abstract method
Downloads a file from a given url to the temporary directory with the given name.
Returns a future that resolves to the downloaded File.
Use onProgress to get notified about the download progress
totalis the total number of bytes to downloaddownloadedis the number of bytes that have been downloaded so farpercentis the percentage of the download that has been completed (between 0 and 1)
Throws an Exception if the download fails.
Implementation
Future<File> download(
String url,
String name, {
void Function(int total, int downloaded, double percent)? onProgress,
});