downloadFile abstract method
Future<void>
downloadFile({
- required String downloadUrl,
- String? fileName,
- String? token,
- DownloadMethod method = DownloadMethod.GET,
- ProgressCallback? onProgress,
- CompletedCallback? onCompleted,
- ErrorCallback? onError,
Downloads a file from the given URL
downloadUrl - URL to download the file from
fileName - Optional name for the downloaded file
token - Optional authorization token for secure downloads
method - HTTP method to use (GET or POST)
onProgress - Optional callback to track download progress
onCompleted - Optional callback when download is completed
onError - Optional callback when an error occurs
Implementation
Future<void> downloadFile(
{required String downloadUrl,
String? fileName,
String? token,
DownloadMethod method = DownloadMethod.GET,
ProgressCallback? onProgress,
CompletedCallback? onCompleted,
ErrorCallback? onError});