flutter_easy_downloader_lib 0.0.1 copy "flutter_easy_downloader_lib: ^0.0.1" to clipboard
flutter_easy_downloader_lib: ^0.0.1 copied to clipboard

A library for flutter that provides an easy to use interface for downloading files to your device.

example/lib/main.dart

import 'dart:io';

import 'package:easy_downloader/easy_downloader.dart';

void main() async {
  var file = File("test.mp4");
  if (file.existsSync()) {
    file.deleteSync();
  }
  await Isar.initializeIsarCore(download: true);
  var isar = await Isar.open(EasyDownloader.schemas, directory: ".");
  var easyDownloader = await EasyDownloader().init(isar: isar);
  var dir = Directory("download");
  if (dir.existsSync()) {
    dir.deleteSync(recursive: true);
  }
  // print(await easyDownloader.allDownloadTasks());
  // return;
  var task = await easyDownloader.download(
    url:
        "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4",
    maxSplit: 10,
  );
  task.addListener((task) {
    print(
        "status: ${task.status} ${task.totalDownloaded.toHumanReadableSize()} / ${task.totalLength.toHumanReadableSize()}");
  });

  task.start();
}
0
likes
130
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

A library for flutter that provides an easy to use interface for downloading files to your device.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

easy_downloader, flutter, flutter_local_notifications, isar_flutter_libs

More

Packages that depend on flutter_easy_downloader_lib