downloadFile method

Future<void> downloadFile(
  1. String url, {
  2. required String filename,
  3. required dynamic onProgressUpdate(
    1. int downloaded,
    2. double? percentage,
    3. File? file
    ),
})

Downloads a file from the specified URL

url - The URL from which to download the file filename - The name to give the downloaded file onProgressUpdate - Callback function to track download progress

Returns a Future that completes when the download is finished

Implementation

Future<void> downloadFile(String url, {required String filename, required Function(int downloaded, double? percentage, File? file) onProgressUpdate}) {
  return PlexNetworking.instance.downloadFile(url, filename: filename, onProgressUpdate: onProgressUpdate);
}