Dart downloader that lets you set a custom chunk sizes for a lot faster downloads.
- custom chunk size downloads
- stop downloads
- pause downloads
- resume downloads
Add this package to your pubspec.yml:
chunked_downloader: x.x.x
You can use it like this: (note that everything is in bytes)
var chunkedDownloader = await ChunkedDownloader(
url: 'https://filesamples.com/samples/video/mjpeg/sample_3840x2160.mjpeg',
savedDir: '/temp',
fileName: 'sometestfile.mjpeg',
chunkSize: 1024 * 1024,
onError: (error) {},
onProgress: (received, total, speed) {},
onDone: (file) {})
.start();
chunkedDownloader.pause();
chunkedDownloader.resume();
chunkedDownloader.stop();