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

套件詳情v2.7.1

functions_client

Supabase 函數的 Dart 客戶端程式庫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
127萬
喜歡數
7
Pub 分數
130

安裝套件

flutter pub add functions_client

套件介紹

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

functions_client 套件是一個 Dart 庫,可讓 Flutter 應用程式與 Supabase Functions 互動,讓開發者能直接從應用程式呼叫無伺服器函數。它提供簡單且類型安全的 API,用於向 Supabase 主機的函數發出 HTTP 請求,支援驗證與錯誤處理。非常適合執行後端邏輯,例如資料處理、檔案操作或第三方整合,而無需管理伺服器。該客戶端可與 Supabase 的驗證和資料庫服務無縫整合。

適用情境

  • 從 Flutter 應用程式呼叫無伺服器函數
  • 在不管理伺服器的情況下執行後端邏輯
  • 與 Supabase 認證和資料庫整合
  • 透過無伺服器函數處理檔案操作
  • 使用自定義後端邏輯自動化工作流程

主要特色

  • 類型安全的函數呼叫
  • 內建驗證支援
  • 錯誤處理與重試機制
  • 跨平台相容性
  • 簡單的 HTTP 請求介面
  • 與 Supabase 生態系統的整合

適合對象

  • 使用 Supabase 的 Flutter 開發人員
  • 需要無伺服器後端邏輯的專案
  • 需要安全函數執行的應用程式
  • 建構全端 Flutter 應用的團隊
  • 希望後端基礎設施盡可能簡化的開發者

使用建議

  • 需要一個已部署函數的 Supabase 項目
  • 必須在 Supabase 中設定驗證
  • 僅限 Supabase Functions 端點
  • 依賴網路連接
  • 不適合複雜的伺服器端應用

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

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。