Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support

Related tags

Templates flutter
Overview

Flutter Download Manager

pub package pub points popularity likes |

Overview

Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support. Manage download tasks by url and be notified of status and their progress. Pause, Cancel, Queue and Resume Downloads.

This package was made as I felt like there are no download managers in flutter, specially with desktop support.

alt Example

Features

  • Manage download tasks by url
  • Ability to notified of status and progress changes
  • Partial Download Feature
  • Queue Downloads
  • Pause, Cancel or Resume Downloads
  • Parallel File Downloads (2 or can change)
  • Support Batch download

Platforms Supported

  • Linux
  • MacOS
  • Windows
  • Android
  • iOS

There are a few caveats about this package:

  • On desktop it saves the file in absolute or relative path.
  • On mobile it saves the file in absolute or relative path, but we should ask/ensure if the app has the required permissions.
  • It does not run in a background process, so when the dart application closes the manager will also shut down.

Getting Started

In your pubspec.yaml file add:

dependencies:
  flutter_download_manager: any

Then, in your code import:

import 'package:flutter_download_manager/flutter_download_manager.dart';

Usage

Please refer to /example folder for a working example.

Simply Download a file

var dl = DownloadManager();
var url = "adasdad.com/asda.sdas";
dl.addDownload(url, "./test.sdas");

DownloadTask? task = dl.getDownload(url4);

task?.status.addListener(() {
  print(task.status.value);
});

task?.progress.addListener(() {
  print(task.progress.value);
});

await dl.whenDownloadComplete(url4);

Get Download Status

DownloadTask? task = dl.getDownload(url4);

task?.status.addListener(() {
  print(task.status.value);
});

Get Download Progress

DownloadTask? task = dl.getDownload(url4);

task?.progress.addListener(() {
  print(task.progress.value);
});

Await for a task to be complete

DownloadTask? task = dl.getDownload(url4);

await task.whenDownloadComplete();

Cancel a task

var dl = DownloadManager();

dl.cancelDownload(url5);

Pause a task

var dl = DownloadManager();

dl.pauseDownload(url5);

Resume a task

var dl = DownloadManager();

dl.resumeDownload(url5);

Download in Batch

var dl = DownloadManager();

var urls = <String>[];
urls.add(url2);
urls.add(url3);
urls.add(url);

dl.addDownload(url2, "./test2.ipa");
dl.addDownload(url3, "./test3.ipa");
dl.addDownload(url, "./test.ipa");

var downloadProgress = dl.getDownloadProgress(urls);

downloadProgress.addListener(() {
  print(downloadProgress.value);
});

await dl.whenDownloadsComplete(urls);
var dl = DownloadManager();

var urls = <String>[];
urls.add(url2);
urls.add(url3);
urls.add(url);

dl.addBatchDownloads(urls, "./");

Cancel a Batch Download

var dl = DownloadManager();

var urls = <String>[];
urls.add(url6);
urls.add(url5);
urls.add(url);

dl.cancelDownloads(urls);

Get Batch Download Progress

var dl = DownloadManager();

var urls = <String>[];
urls.add(url2);
urls.add(url3);

var downloadProgress = dl.getDownloadProgress(urls);

downloadProgress.addListener(() {
  print(downloadProgress.value);
});

Await for Batch Download to complete

var dl = DownloadManager();

var urls = <String>[];
urls.add(url2);
urls.add(url3);
urls.add(url);

await dl.whenDownloadsComplete(urls);

Future Work

[] Add in Shared Preference to survive app shutdown

DownloadStatus

enum DownloadStatus { queued, downloading, completed, failed, paused, canceled }

You might also like...

Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Flutter Tutorial - Download Files From Firebase Storage Download files from Firebase Storage with Flutter. List all images, videos, or other files fro

Dec 4, 2022

Flutter file based routing - File based routing and nested layouts for Flutter

Flutter File Based Routing I was inspired by the routing in remix.run with neste

Sep 29, 2022

This project is a rebuild of the existing movie colony https://github.com/debbsefe/Movie-Colony. Here's also a link to the figma file https://www.figma.com/file/XpLFNEsROiN1z6lwnNHMrU/Movie-app?node-id=2956%3A10161

Tvfiy Generated by the Very Good CLI 🤖 A Very Good Project created by Very Good CLI. Getting Started 🚀 This project contains 3 flavors: development

Nov 12, 2022

Flutter file manager - Flutter package for managing files on Android

Flutter file manager - Flutter package for managing files on Android

flutter_file_utils Helper tools for managing files on Android. Getting Started For help getting started with Flutter, view our online documentation. F

Nov 11, 2022

RT File Manager (Acronym TBD)

RT File Manager (Acronym tbd) Linux file manager with inspiration from GNOME Files and MacOS's Finder Everything is WIP, most features missing! Made i

Dec 15, 2022

Daily-Task-Manager a daily task manager application project created in flutter

Daily-Task-Manager a daily task manager application project created in flutter

This is a daily task manager application project created in flutter. Install this application on Android - Install from Play Store

May 10, 2022

Kyber Mod Manager A Mod Manager build for Kyber.

Kyber Mod Manager A Mod Manager build for Kyber.

Kyber Mod Manager A Mod Manager build for Kyber. This app is not affiliated with Kyber or any of its creators. Key Features • Download • Screenshots •

Sep 25, 2022

An audiobook downloader and player in flutter using librivox api (WIP)

An audiobook downloader and player in flutter using librivox api (WIP)

Flutter AudioBooks An audiobook listener and downloader in flutter using librivox API (WIP). Why? I wanted to make a beautiful AudioBook app, free for

Jan 5, 2023

A powerful past paper downloader for IGCSE and A-Level.

A powerful past paper downloader for IGCSE and A-Level.

Past Paper Finder Past Paper Finder is a past paper downloader for IGCSE and A-Level. It is designed to be as simple as possible and easy to use. Feat

Dec 12, 2022
Comments
  • Add Platform.pathSeparator instead putting

    Add Platform.pathSeparator instead putting "/" when building the directory.

    At the downloader.dart file, on the addDownload method there is a / hardcoded. Suggestion to replace by Platform.pathSeparator, because of Windows systems (yeah... you know, multiplatform stuff).

          var downloadFilename = isDirectory
              ? savedDir + Platform.pathSeparator + getFileNameFromUrl(url)
              : savedDir;
    
    opened by ortolanph 3
  • Exception: type _CompactIterable<DownloadTask>' is not a subtype of type 'List<DownloadTask>

    Exception: type _CompactIterable' is not a subtype of type 'List

    flutter_download_manager: ^0.5.3

    I/flutter (19219): type '_CompactIterable<DownloadTask>' is not a subtype of type 'List<DownloadTask>' in type cast
    I/flutter (19219): #0      DownloadManager.getAllDownloads (package:flutter_download_manager/src/downloader.dart:228:26)
    

    Please, change

    List<DownloadTask> getAllDownloads() {
        return _cache.values as List<DownloadTask>;
    }
    

    to

    List<DownloadTask> getAllDownloads() {
        return _cache.values.toList();
    }
    
    opened by brun0xon 1
Owner
Nabil Mosharraf
Android Lead.Love to build best mobile experiences using Android, iOS and Flutter. I Know React, javasript, Python, Kotlin/java, Flutter using Dart
Nabil Mosharraf
A simple flutter app that downloads a file from the internet, shows a custom-made download progress dialog and saves the file to device's internal storage

http_downloader A simple flutter app that downloads a file from the internet using the http plugin. It has a custom-designed progress dialog which dis

Akora Ing. Debrah Kwesi Buabeng 4 Apr 6, 2021
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android.

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Md Abir Ahsan Tahmim 1 Dec 8, 2021
Flutter youtube downloader - A Windows App made in Flutter to download mp3 or mp4 from a Youtube video

youtube_downloader A Windows App made in Flutter to download mp3 or mp4 from a Y

Sakshham Bhagat 3 Nov 30, 2022
An HTTP file downloader packed with many features -> resumable downloads, multiple connections, buffering, auto-retry, etc.

An HTTP file downloader packed with many features -> resumable downloads, multiple connections, buffering, auto-retry, etc. Features Resumable downloa

Liu YuanYuan 4 Feb 2, 2022
A lightweight and powerful batch library written in Dart

A lightweight and powerful batch library written in Dart. You can easily develop a job schedule and batch program in Dart with this library.

Kato Shinya 24 Dec 13, 2022
A cross-platform Flutter home workout app that respects your privacy. THIS IS A GITLAB MIRROR, file issues and contribute there.

Feeel Feeel is an open-source workout app for doing simple at-home exercises. This is a rewrite of the original app in Flutter, to make development ea

null 27 Dec 26, 2022
A library for widgets that load their content one page (or batch) at a time.

A library for widgets that load their content one page (or batch) at a time (also known as lazy-loading and pagination). Features Load data one page a

null 224 Oct 20, 2022
Open-source, cross-platform, hassle-free file sharing with AES-256 encryption made with Flutter & Dart.

Odin âš¡ Open source easy file sharing for everyone. âš¡ Cross-platform hassle-free file sharing with AES-256 encryption made with Flutter & Dart. Getting

Odin 111 Dec 22, 2022
Cross-Platform Google Drive client with encryption support.

arthurmorgan A Cross-Platform Google Drive client with encryption support. Features implemented Google OAuth2 Upload Files Download Single Files Uploa

Washiul Alam Sohan 45 Aug 14, 2023