downloadWithProgress abstract method
Downloads a file with progress tracking
Returns a stream of progress percentages (0-100)
Parameters:
url
: Source URLtargetPath
: Destination pathtoken
: Optional auth tokenmaxRetries
: Max retry attempts for transient errors (default: 10) Note: Auth errors (401/403/404) fail after 1 attempt regardless of this value
Example:
await for (final progress in downloader.downloadWithProgress(...)) {
print('Progress: $progress%');
}
Implementation
Stream<int> downloadWithProgress(
String url,
String targetPath, {
String? token,
int maxRetries = 10,
});