搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.1

download

適用於 Dart 和 Flutter 專案的跨平台檔案下載器。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.7萬
喜歡數
82
Pub 分數
140

安裝套件

flutter pub add download

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

下載套件為 Dart 與 Flutter 應用程式提供跨平台的檔案下載器,可在 Android、iOS、Web、macOS、Windows 及 Linux 上實現無縫檔案下載。它提供簡單的 API 來啟動下載、監控進度,並以平台特定優化處理檔案儲存。設計上強調可靠性與易用性,支援背景下載,並能順暢整合至需要離線內容或媒體取得之應用程式中。

適用情境

  • 從移動應用程式中的URL下載檔案
  • 獲取離線使用的資源
  • 支援所有平台的背景下載
  • 與媒體或文件管理功能整合
  • 透過可下載的捆綁包啟用應用程式更新

主要特色

  • 跨平台相容性
  • 下載過程中的進度追蹤
  • 背景下載支援
  • 簡單的整合API
  • 平台最佳化的檔案處理

適合對象

  • 行動與桌面 Flutter 應用
  • 需要離線內容的應用程式
  • 媒體或文件密集型應用
  • 需要可靠文件檢索的專案
  • 尋求最小化設定以進行下載的開發者

使用建議

  • Android 和 iOS 需要正確的權限
  • Web 支援受限於瀏覽器政策
  • 大檔案可能需要記憶體管理
  • 檔案路徑處理因平台而異
  • 某些平台上的背景執行限制

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Cross-Platform file downloader for Dart and Flutter projects.

pub package

Demo

Web Demo

Features

Supports these platforms:

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

There are a few caveats about this package:

  • On the web it caches the contents in a Blob and eventually saves the file in browser's default location.
  • 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.
  • On the web, not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).

Getting started

In your pubspec.yaml file add:

dependencies:
  download: any

Then, in your code import:

import 'package:download/download.dart';

Usage

final stream = Stream.fromIterable('Hello World!'.codeUnits);
download(stream, 'hello.txt');

or

import 'package:http/http.dart';
const url = 'http://example.com';

final stream = get(url);
download(stream, 'hello.txt');

Please refer to /example folder for a working example.

Additional information

Please feel free to contribute to the project or file an issue.

所屬分類

原始碼儲存庫

使用此套件的專案