ProgressiveDownloader class

Progressive HTTP downloader that streams bytes to a growing file. Supports resume, cancellation, progress reporting, and waiting for minimum bytes. Uses HTTP client pooling for connection reuse.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

cancel(String url) → void
Cancel an active download.
cancelAll() → void
Cancel all active downloads.
download({required String url, required String filePath, int startByte = 0, Map<String, String>? headers}) Stream<DownloadProgress>
Start downloading url to filePath, resuming from startByte. Returns a stream of progress updates.
downloadAndWaitForBytes({required String url, required String filePath, int startByte = 0, int minBytes = minBytesForPlayback, Map<String, String>? headers}) Future<DownloadResult>
Start downloading and wait until minimum bytes are available. Returns a Future that completes when minBytes are downloaded. Download continues in background after Future completes.

Constants

chunkSize → const int
Chunk size for progress reporting (64KB)
maxConnections → const int
Maximum HTTP connections for pooling
minBytesForPlayback → const int
Minimum bytes needed for ExoPlayer/AVPlayer to start playback Increased from 64KB to 128KB for smoother playback start