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

套件詳情v2.27.3

gotrue

GoTrue API 的 Dart 客戶端程式庫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
132萬
喜歡數
16
Pub 分數
140

安裝套件

flutter pub add gotrue

套件介紹

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

一個用於與 GoTrue 認證 API 互動的 Dart 客戶端程式庫,可在 Flutter 應用中實現安全的使用者管理。支援註冊、登入、密碼復原及會話處理,並具備內建的權杖管理功能。專為與 Supabase 無縫整合而設計,可在多個平台提供一致的驗證體驗。該程式庫可處理狀態持久化,並透過監聽器提供即時更新。非常適合需要強大且可擴展驗證功能的應用開發。

適用情境

  • 用戶註冊和登錄
  • 密碼重置工作流程
  • 會話管理
  • 即時驗證狀態更新
  • 多平台認證

主要特色

  • 安全的令牌處理
  • 內建會話持久化
  • 即時身分驗證監聽器
  • 支援電子郵件/密碼和社交登入
  • 跨平台相容性

適合對象

  • 使用 Supabase 的 Flutter 應用
  • 需要安全驗證的應用程式
  • 開發跨平台應用的開發者
  • 需要即時驗證狀態的專案
  • 希望簡單驗證設定的團隊

使用建議

  • 需要一個 GoTrue 後端(例如 Supabase)
  • 僅限 GoTrue 特定功能
  • 需要對網路問題進行適當的錯誤處理
  • 認證流程必須針對 UI 進行自定義
  • 依賴於 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

所屬分類

依賴

依賴清單 8 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。