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

パッケージ詳細v1.8.4

al_downloader

任意の種類のファイルをダウンロードできるURLベースのFlutterダウンローダーで、多くのことを自動的に管理します。

AndroidiOS
30日間ダウンロード
486
いいね数
104
Pub ポイント
120

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

flutter pub add al_downloader

パッケージ概要

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

al_downloader は、Android および iOS プラットフォーム上で URL を使用したファイルのダウンロードを可能にする Flutter パッケージです。任意のファイル形式のダウンロードをサポートし、ダウンロードキューの管理、進捗の追跡、ストレージ権限の管理といった一般的なタスクを自動で処理します。Flutter アプリ内に堅牢なダウンロード機能を実装するのを容易にし、信頼性の高いバックグラウンドダウンロードが必要なアプリケーションに最適です。pub add を通じた最小限の設定で、開発者は強力なダウンロード機能を簡単に統合できます。

用途

  • URLからファイルをダウンロードする
  • バックグラウンドファイルのダウンロード
  • 大容量ファイルの転送処理
  • ダウンロード進捗の管理
  • 自動ダウンロードキュー管理

主な機能

  • すべてのファイル形式をサポートしています
  • 自動ダウンロード管理
  • クロスプラットフォーム(AndroidおよびiOS)
  • 進捗の追跡
  • バックグラウンドダウンロードのサポート

適している対象

  • ファイルのダウンロードが必要なアプリ
  • メディアコンテンツ配信
  • オフラインデータキャッシュ
  • 教育または生産性アプリ
  • 大規模なアセットライブラリを持つアプリケーション

注意事項

  • Androidでインターネット権限が必要です
  • iOSでバックグラウンド実行の権限が必要になる場合があります
  • 大きなファイルには注意深いメモリ管理が必要です
  • ファイルパスの処理は、プラットフォームによって異なる場合があります
  • 組み込みの再開機能について言及されていない

元の README

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

al_downloader

pub package

A URL-based flutter downloader that supports to download any type of file and automatically manages a lot of things.

If you need Chinese Document, click here.

Features

  • manage download tasks by url
  • simple download status
  • I/O infrequently
  • provide convenient download handle
  • support batch download
  • manage automatically files without requiring to be specified a download path
  • based on flutter_downloader

Integration

Native Config: same as flutter_downloader native config

add the following line to your pubspec.yaml

dependencies:
  al_downloader: ^1.8.4

run the following line with your command line

flutter packages get

import the following line, then you can use al_downloader

import 'package:al_downloader/al_downloader.dart';

Usage

ALDownloader
Initialize
ALDownloader.initialize();
Configure print
ALDownloader.configurePrint(true, frequentEnabled: false);
Download
ALDownloader.download(url,
    directoryPath: directoryPath,
    fileName: fileName,
    handlerInterface:
        ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }));
Add a handler interface
ALDownloader.addHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }),
    url);
Add a forever handler interface
ALDownloader.addForeverHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }),
    url);
Remove handler interface
ALDownloader.removeHandlerInterfaceForUrl(url);
Pause download
/// Stop download, but the incomplete data will not be deleted.
ALDownloader.pause(url);
Cancel download
/// Stop download, and the incomplete data will be deleted.
ALDownloader.cancel(url);
Remove download
/// Remove download, and all the data will be deleted.
ALDownloader.remove(url);
Get download status
final status = await ALDownloader.getStatusForUrl(url);
Get download progress
final progress = await ALDownloader.getProgressForUrl(url);
Get task
final task = await ALDownloader.getTaskForUrl(url);
Get all tasks
final tasks = await ALDownloader.tasks;
ALDownloaderBatcher
Batch download
ALDownloaderBatcher.download(urls,
    handlerInterface:
        ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint('ALDownloader | batch | download progress = $progress\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | batch | download succeeded\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | batch | download failed\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | batch | download paused\n');
    }));
Add a handler interface for batch
ALDownloaderBatcher.addHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint('ALDownloader | batch | download progress = $progress\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | batch | download succeeded\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | batch | download failed\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | batch | download paused\n');
    }),
    urls);
Get download status for a set of urls
final status = await ALDownloaderBatcher.getStatusForUrls(urls);
Get tasks
final tasks = await ALDownloaderBatcher.getTasksForUrls(urls);
ALDownloaderFileManager - A manager that manages file by url
final physicalFilePath =
    await ALDownloaderFileManager.getPhysicalFilePathForUrl(url);
debugPrint(
    'ALDownloader | get physical file path for [url], url = $url, path = $physicalFilePath\n');

Note:

1. If the persistent file was removed by exceptional means, such as the cache folder being deleted by some business code, call [remove] and then call [download] to re-download for fixing the problem.

Key File Of Example

iOS
Android

Contributing

Welcome contribution!

Welcome to open issue or PR for any problem, suggestion and idea!

Maintainer: jackleemeta (jackleemeta@outlook.com)

カテゴリー

依存関係

依存関係一覧 7 件

ソースリポジトリ

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

データはまだありません。