パッケージ、リポジトリ、アプリカテゴリを検索

flutter_download_manager のカバー
パッケージ詳細v0.5.5

flutter_download_manager

Flutterダウンロードマネージャーは、再開可能、並列およびバッチダウンロードをサポートするクロスプラットフォームのファイルダウンローダーです。また、ダウンロード状態や進行状況の更新について通知を受け取ることができます

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
3580
いいね数
74
Pub ポイント
130

パッケージをインストール

flutter pub add flutter_download_manager

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterダウンロードマネージャーは、中断されたダウンロードの再開、並列処理およびバッチ処理をサポートするクロスプラットフォームパッケージです。リアルタイムでの進捗状況の更新とステータス通知を提供し、Android、iOS、macOS、Windows、Linuxで堅牢なダウンロード機能を必要とするアプリに最適です。複数のダウンロードを効率的に管理しながら、データの整合性とユーザーへのフィードバックを保証します。

用途

  • バッチファイルのダウンロード
  • 中断されたダウンロードを再開する
  • リアルタイムでの進捗追跡
  • バックグラウンドダウンロード
  • 大容量ファイルの転送
  • オフラインコンテンツのキャッシュ

主な機能

  • 再開可能なダウンロード
  • 並列およびバッチダウンロード
  • クロスプラットフォーム対応
  • 進行状況およびステータスコールバック
  • シンプルな API インテグレーション
  • バックグラウンドダウンロードの処理

適している対象

  • オフラインコンテンツを必要とするアプリ
  • メディアストリーミングアプリ
  • ファイル管理ツール
  • ダウンロード可能なリソースを備えた教育アプリ
  • 大規模ファイル操作を備えたエンタープライズアプリ

注意事項

  • Androidでインターネット権限が必要です
  • バックグラウンド実行は、プラットフォームによって異なる場合があります
  • 大きなダウンロードはバッテリーとデータ使用に影響する可能性があります
  • ダウンロードUIのカスタマイズが限定的
  • 組み込みのダウンロードキュー優先順位なし
  • プラットフォーム固有の設定が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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";
await 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);

await dl.addDownload(url2, "./test2.ipa");
await dl.addDownload(url3, "./test3.ipa");
await 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 }

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト