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

套件詳情v1.1.0

chunked_uploader

一個易於使用的套件,使用 Dio 在行動裝置、桌面和網頁上以區塊方式上傳檔案。

AndroidiOSmacOSWindowsLinux
近 30 天下載
1540
喜歡數
35
Pub 分數
150

安裝套件

flutter pub add chunked_uploader

套件介紹

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

一個輕量級的 Flutter 套件,使用 Dio 簡化大檔案分塊上傳。它支援行動裝置、桌面與 Web 平台,即使在不穩定的連線下也能確保可靠的上傳。此套件可無縫處理分塊、進度追蹤與可復原上傳,非常適合需要強大檔案傳輸功能的應用程式。設計時著重於簡單性與效能,能順暢整合至現有專案。

適用情境

  • 上傳大型影片檔案
  • 可恢復的檔案傳輸
  • 上傳過程中的進度追蹤
  • Web 和跨平台檔案共享
  • 離線上傳功能

主要特色

  • 分塊檔案上傳
  • 進度監控
  • 可恢復上傳
  • 跨平台支援
  • 基於Dio的整合

適合對象

  • 大檔案處理
  • 網路敏感應用
  • 行動和桌面應用
  • Web 檔案上傳器
  • 需要上傳彈性的應用

使用建議

  • 需要 Dio 依賴
  • 需要伺服器端區塊處理
  • 不適用於小檔案
  • 僅限HTTP上傳
  • 無內建驗證

原始 README

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

Chunked Uploader

A plugin to upload files to server in chunks.

pub package

Usage

To use this plugin, add chunked_uploader as dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
  chunked_uploader: ^1.0.0
  file_picker: ^5.2.5
  dio: ^4.0.6

Example

final file =
    (await FilePicker.platform.pickFiles(withReadStream: true))!.files.single;
final dio = Dio(BaseOptions(
  baseUrl: 'https://example.com/api',
  headers: {'Authorization': 'Bearer'},
));
final uploader = ChunkedUploader(dio);

// using data stream
final response = await uploader.upload(
  fileName: file.name,
  fileSize: file.size,
  fileDataStream: file.readStream!,
  maxChunkSize: 500000,
  path: '/file',
  onUploadProgress: (progress) => print(progress),
);
// using path
final response = await uploader.uploadUsingFilePath(
  fileName: file.name,
  filePath: file.path!,
  maxChunkSize: 500000,
  path: '/file',
  onUploadProgress: (progress) => print(progress),
);

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。