Skip to main content

vibe_large_file_downloader 0.1.1 copy "vibe_large_file_downloader: ^0.1.1" to clipboard
vibe_large_file_downloader: ^0.1.1 copied to clipboard

Downloads large files to disk in chunks, with resume, progress, cancel and size and checksum verification before the file is put in place.

example/vibe_large_file_downloader_example.dart

import 'package:vibe_large_file_downloader/vibe_large_file_downloader.dart';

Future<void> main() async {
  final downloader = Downloader(); // SHA-256 by default
  final spec = FetchSpec(
    url: 'https://example.com/file.bin',
    bytes: 1048576,
    digest: 'replace-with-the-published-sha256',
  );
  try {
    final r = await downloader.download(
      spec,
      '/tmp/file.bin',
      onProgress: (got, total) => print('${(100 * got / total).round()}%'),
    );
    print('saved ${r.file.path}, verified: ${r.verified}');
  } on FetchError catch (e) {
    print(
        'failed: ${e.code.name}'); // network, size, hash, cancelled, notAFile, missing
  } finally {
    downloader.close();
  }
}
0
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Downloads large files to disk in chunks, with resume, progress, cancel and size and checksum verification before the file is put in place.

Repository (GitHub)
View/report issues

Topics

#download #checksum #http #sha256

License

MIT (license)

Dependencies

crypto, http, path

More

Packages that depend on vibe_large_file_downloader