range_request 0.2.0
range_request: ^0.2.0 copied to clipboard
A Dart package for efficient HTTP range requests supporting parallel chunked downloads, resume capability, and checksum verification.
Changelog #
0.2.0 #
Breaking Changes #
- Moved
progressIntervalparameter from method calls to configurationRangeRequestClient.fetch()no longer acceptsprogressIntervalparameterFileDownloader.downloadToFile()no longer acceptsprogressIntervalparameter- Migration: Pass
progressIntervalviaRangeRequestConfiginstead:// Before client.fetch(url, progressInterval: Duration(seconds: 1)) // After final client = RangeRequestClient( config: RangeRequestConfig(progressInterval: Duration(seconds: 1)) ); client.fetch(url)
Features #
-
Added
CancelTokenGroupclass for managing multiple cancel tokens- Cancel all tokens simultaneously with
cancelAll() - Check group cancellation status
- Add/remove tokens dynamically
- Clear tokens without cancelling
- Cancel all tokens simultaneously with
-
Added
cancelAndClear()method toRangeRequestClient- Cancel all active operations and clear tokens in a single call
- Useful for resetting download state
-
Added
copyWith()method toRangeRequestConfig- Easily create modified configuration instances
-
Made
FileDownloaderconstructor parameter optional- Can now instantiate without arguments:
FileDownloader()
- Can now instantiate without arguments:
-
Added simplified HTTP abstraction with
HttpandDefaultHttpclasses- Cleaner API for HTTP client customization
Improvements #
- Significantly improved test execution speed (5s → 200ms for cancellation tests)
- Enhanced test reliability with mock-based infrastructure
- Better API ergonomics with shorter class names
- Unified HTTP client abstraction pattern
Documentation #
- Added "Managing Multiple Downloads" section to README
- Enhanced API reference with new cancellation methods
- Improved code examples and migration guides
0.1.0 #
Initial release of the range_request package for efficient HTTP file downloads with range request support.
Features #
- Parallel chunked downloads - Split large files into chunks for concurrent downloading
- Automatic resume capability - Continue interrupted downloads from where they left off
- Checksum verification - Verify file integrity with MD5/SHA256 algorithms
- Smart server fallback - Automatically falls back to serial download if server doesn't support range requests
- Real-time progress tracking - Monitor download progress with customizable update intervals
- Graceful cancellation - Cancel downloads cleanly using CancelToken
- File conflict strategies - Handle existing files with overwrite, rename, or error options
- Temporary file cleanup - Utility for removing incomplete download files
- Isolate-based file I/O - Non-blocking file operations prevent UI freezing
- Exponential backoff retry - Smart retry logic for failed chunks with increasing delays
- Memory-efficient streaming - Process large files without loading entire content into memory
- Configurable parameters - Fine-tune chunk size, concurrency, timeouts, and retry behavior
Infrastructure #
- Cross-platform support for iOS, Android, Web, Windows, macOS, and Linux
- Minimal dependencies:
http: ^1.1.0andcrypto: ^3.0.0 - Dart SDK requirement: ^3.8.0
- Example Flutter app demonstrating package capabilities