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

套件詳情v4.0.1

flutter_auth_ui

適用於 Flutter 的非官方 firebaseui 套件。此套件旨在提供對 Android、iOS 和 Web 的支援。支援透過電子郵件、電話、Google 帳戶等進行登入。

AndroidiOSWeb
近 30 天下載
156
喜歡數
68
Pub 分數
140

安裝套件

flutter pub add flutter_auth_ui

套件介紹

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

flutter_auth_ui 是一個非官方的 Flutter 套件,受到 FirebaseUI 啟發,旨在簡化 Android、iOS 和 Web 平台上的驗證。它提供用於常見驗證流程(包括電子郵件、電話和 Google 登入)的預建 UI 元件。利用 Flutter 的跨平台功能建構,旨在減少重複程式碼,同時維持一致的使用者體驗。該套件可與 Firebase Authentication 無縫整合,並支援現代驗證模式,如無密碼登入和多重因素驗證。

適用情境

  • 實現電子郵件/密碼登入
  • 啟用 Google 登入
  • 新增電話號碼驗證
  • 在網頁上建構安全的登入流程
  • 支援多平台應用

主要特色

  • 預建構的驗證 UI
  • 跨平台支援(Android、iOS、Web)
  • 與 Firebase 認證整合
  • 無密碼和多因素認證支援
  • 可自訂主題和樣式

適合對象

  • 開發跨平台應用的開發者
  • 需要快速身份驗證實施的團隊
  • 使用 Firebase 作為後端的項目
  • 在設備間需要一致的驗證使用者體驗的應用程式
  • 專注於快速MVP開發的初創公司

使用建議

  • 需要 Firebase 設定
  • 與原生UI相比,自訂選項有限
  • 依賴外部 Firebase 服務
  • 可能需要額外的狀態管理
  • 非 Firebase 官方維護

原始 README

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

flutter_auth_ui

Unofficial firebaseui package for flutter. This library aims to provide support for Android, iOS and the web. Login with Email, Phone, Google account and etc.

Getting Started

This plugin is wrapped Android/iOS/Web native plugin.

Check documents and setup your firebase project.

How to use

// Set provider
final providers = [
  AuthUiProvider.anonymous,
  AuthUiProvider.email,
  AuthUiProvider.phone,
  AuthUiProvider.apple,
  AuthUiProvider.facebook,
  AuthUiProvider.github,
  AuthUiProvider.google,
  AuthUiProvider.microsoft,
  AuthUiProvider.yahoo,
  AuthUiProvider.twitter,
];

final result = await FlutterAuthUi.startUi(
  items: providers,
  tosAndPrivacyPolicy: const TosAndPrivacyPolicy(
    tosUrl: "https://www.google.com",
    privacyPolicyUrl: "https://www.google.com",
  ),
  androidOption: const AndroidOption(
    enableSmartLock: false, // default true
    showLogo: true, // default false
    overrideTheme: true, // default false
  ),
  emailAuthOption: const EmailAuthOption(
    requireDisplayName: true, // default true
    enableMailLink: false, // default false
    handleURL: '',
    androidPackageName: '',
    androidMinimumVersion: '',
  ),
);

Requirements

Android
  • minSdkVersion 21
  • compileSdkVersion 34
iOS
  • iOS 13 or higher

Link

Tips

EmailLink

Note: In order to implement EmailLink, you will need to prepare in advance; check the firebase documentation first.

Let's check the code sample for firebase auth.

Android

To handle dynamic link, add FlutterAuthUiPlugin.catchEmailLink to onCreate and onNewIntent. (If you don't use EmailLink, then you don't need to add it.)

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.dr1009.app.flutter_auth_ui.FlutterAuthUiPlugin;

import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // check intent
        FlutterAuthUiPlugin.catchEmailLink(this, getIntent());
    }

    @Override
    protected void onNewIntent(@NonNull Intent intent) {
        super.onNewIntent(intent);

        // check intent
        FlutterAuthUiPlugin.catchEmailLink(this, intent);
    }
}
Localizing
Android

Supported without any special settings.

iOS

Check Localizing for iOS: Updating the iOS app bundle.

Web

Check Installation - Option 1: CDN - Localized Widget.

To change the title of AppBar on Android

Add the string value as app_name or fui_default_toolbar_title to your app's strings.xml file. Sample code is strings.xml.

Behavior depends on FirebaseUI-Android.

Show Logo (Android)
  1. Add your logo resource file to android/app/src/main/res/drawable/flutter_auth_ui_logo.xml or android/app/src/main/res/drawable-{m~xxxhdpi}/flutter_auth_ui_logo.png
  2. Enable AndroidOption.showLogo
Change Appbar and link color (Android)
  1. Add flutter_auth_ui_style style to your android/app/src/main/res/values/style.xml
  1. Enable AndroidOption.overrideTheme

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。