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

套件詳情v2.8.1

storage_client

Dart 客戶端程式庫,用於與 Supabase Storage 互動。Supabase Storage 提供了一個介面,用於管理儲存在 S3 中的檔案,並使用 Postgres 來管理權限。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
127萬
喜歡數
33
Pub 分數
140

安裝套件

flutter pub add storage_client

套件介紹

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

storage_client 套件是一個 Dart 庫,可讓 Flutter 應用程式與 Supabase Storage 進行互動,Supabase Storage 是一個用於管理 S3 相容儲存空間中檔案的服務,並透過 PostgreSQL 驅動的存取控制進行管理。它提供安全上傳、下載、列出和刪除檔案的方法,利用 Supabase 的驗證和權限系統。此套件專為與 Supabase 專案無縫整合而設計,支援所有主要平台,包括行動裝置、網頁和桌面端。該套件簡化了檔案處理,同時透過基於角色的存取控制維持強大的安全性。

適用情境

  • 上傳使用者產生的內容,例如圖片或文件
  • 管理儲存在雲端儲存中的應用資源
  • 在使用者之間實現安全檔案分享
  • 在即時應用中儲存和檢索媒體檔案
  • 在Flutter應用中啟用動態內容分發

主要特色

  • 透過 Supabase 認證進行安全檔案操作
  • 對 S3 相容儲存後端的支援
  • 跨平台相容性(Android、iOS、Web、macOS、Windows、Linux)
  • 與 Postgres 集成以實現細粒度權限
  • 用於上傳、下載和列出檔案的簡單 API

適合對象

  • 使用 Supabase 作為後端的 Flutter 應用
  • 需要安全文件管理的應用程式
  • 需要可擴展雲端儲存並具備存取控制的專案
  • 開發媒體密集型或基於文件的應用程式開發者
  • 團隊已使用 Supabase 進行驗證和資料庫

使用建議

  • 需要一個啟用儲存功能的 Supabase 項目
  • 必須在應用中設定驗證
  • 檔案存取權限取決於Postgres策略
  • 受限於 Supabase 的儲存基礎設施
  • 可能需要為自訂 S3 配置進行額外設定

原始 README

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


Supabase Logo

Supabase Flutter

Flutter client library for Supabase.

Guides · Reference Docs · Migration Guides

Build Package License: MIT

Run locally

This repo is a monorepo powered by Melos containing supabase_flutter and its sub-libraries. All packages are located in the packages directory.

To install on a locally developed app:

  • Clone this repo
  • Install Melos globally if you haven't already: dart pub global activate melos
  • Run melos bootstrap or melos bs at the root of the cloned directory to install dependencies
  • Add the target package to your pubspec.yaml file specifying the path.
    supabase_flutter:
      path: <your-path-to-the-local-supabase-flutter-repo>/packages/supabase_flutter
    

Testing your app

The helpers the test suites of these packages run on are published in package:supabase_test, so your tests can build on the same primitives: mock HTTP clients, JWT builders, auth session fixtures and realtime frames. Add the package as a dev dependency:

dev_dependencies:
  supabase_test: ^0.1.0

Then stub the endpoints the code under test talks to and run it against a real SupabaseClient, with no running stack required:

final httpClient = MockSupabaseHttpClient()
  ..stubTable('todos', rows: [
    {'id': 1, 'task': 'Ship it', 'status': false},
  ]);
final supabase = testSupabaseClient(httpClient: httpClient);
addTearDown(supabase.dispose);

final todos = await supabase.from('todos').select();
expect(todos, hasLength(1));

See the supabase_test README for the full guide: stubbing database, rpc, edge function and auth endpoints, asserting on recorded requests, running tests as a signed-in user, and wiring Supabase.initialize in Flutter widget tests.

Testing this repo

The tests for the packages postgrest, supabase_auth, supabase_realtime and supabase_storage run against a local Supabase stack. To run these tests locally you need docker and the Supabase CLI installed.

The single configuration for the stack lives in the supabase directory at the repository root. Start it with:

supabase start

Run the Dart tests within the package directory in packages/<package> with the following command. The -j 1 flag runs the tests not concurrently, which works better since the tests run against the same services.

dart test -j 1

To stop the stack run the following command from the repository root:

supabase stop

Contributing

  • Fork the repo on GitHub
  • Clone the project to your own machine
  • Commit changes to your own branch
  • Push your work back up to your fork
  • Submit a Pull request so that we can review your changes and merge

License

This repo is licensed under MIT.

Resources

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。