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

套件詳情v2.18.3

supabase_flutter

Supabase 的 Flutter 結合。此套件讓開發人員能輕鬆建立安全且可擴展的產品。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
131萬
喜歡數
990
Pub 分數
150

安裝套件

flutter pub add supabase_flutter

套件介紹

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

Supabase Flutter 是一個全面的套件,可將 Supabase 的後端服務整合至 Flutter 應用程式中。它讓開發者能輕鬆實作驗證、即時資料庫操作與雲端儲存,且設定簡單。此套件專為安全性與可擴展性設計,支援多種平台,包括 Android、iOS、Web、macOS、Windows 與 Linux。該套件簡化了對 Supabase 的 PostgreSQL 資料庫、使用者管理與檔案儲存的存取,協助開發者快速建構功能完整的全端應用程式。

適用情境

  • 行動應用程式中的使用者驗證
  • 即時資料同步
  • 基於雲的檔案儲存
  • 安全的API整合
  • 建構可擴展的Web和移動應用
  • 離線優先的應用開發

主要特色

  • 內建的電子郵件/密碼和社交提供者驗證
  • 即時資料庫訂閱
  • 透過雲端儲存進行安全的檔案上傳和下載
  • 跨平台支援
  • 易於使用的 SDK,提供 Flutter 友好的 API
  • 自動模式遷移和行級安全

適合對象

  • Flutter 開發人員建構全端應用程式
  • 需要安全、可擴展後端的團隊
  • 初創公司快速原型設計,後端工作量最小
  • 需要即時資料更新的應用程式
  • 使用 PostgreSQL 作為其資料庫的開發人員
  • 針對多個平台的專案

使用建議

  • 需要設置 Supabase 項目
  • 即時功能的網路依賴
  • 進階安全規則的學習曲線
  • 沒有後端知識的有限自訂
  • 取決於 Supabase 服務的可用性
  • 離線場景下的潛在延遲

原始 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

所屬分類

依賴

依賴清單 11 項

原始碼儲存庫

使用此套件的專案