firebase_ui_auth 1.16.1 copy "firebase_ui_auth: ^1.16.1" to clipboard
firebase_ui_auth: ^1.16.1 copied to clipboard

Pre-built widgets library that are integrated with the variety of the Firebase Auth providers.

Firebase UI Auth #

pub package

Firebase UI Auth is a set of Flutter widgets and utilities designed to help you build and integrate your user interface with Firebase Authentication.

Please contribute to the discussion with feedback.

Platform support #

Feature/platform Android iOS Web macOS Windows Linux
Email (1) (1)
Phone
Email link
Email verification (2) (2) (1) (1)
Sign in with Apple
Google Sign in (1) (1)
Twitter Login (1) (1)
Facebook Sign in (1) (1)
  1. Available with flutterfire_desktop
  2. No deep-linking into app, so email verification link opens a web page

Installation #

flutter pub add firebase_ui_auth
copied to clipboard

Example #

Here's a quick example that shows how to build a SignInScreen and ProfileScreen in your app

import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider;
import 'package:firebase_ui_auth/firebase_ui_auth.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final providers = [EmailAuthProvider()];

    void onSignedIn() {
      Navigator.pushReplacementNamed(context, '/profile');
    }

    return MaterialApp(
      initialRoute: FirebaseAuth.instance.currentUser == null ? '/sign-in' : '/profile',
      routes: {
        '/sign-in': (context) {
          return SignInScreen(
            providers: providers,
            actions: [
              AuthStateChangeAction<UserCreated>((context, state) {
                // Put any new user logic here
                onSignedIn();
              }),
              AuthStateChangeAction<SignedIn>((context, state) {
                onSignedIn();
              }),
            ],
          );
        },
        '/profile': (context) {
          return ProfileScreen(
            providers: providers,
            actions: [
              SignedOutAction((context) {
                Navigator.pushReplacementNamed(context, '/sign-in');
              }),
            ],
          );
        },
      },
    );
  }
}
copied to clipboard

Profile screen icons #

If you're using ProfileScreen, make sure to add the following to your pubspec.yaml:

fonts:
  - family: SocialIcons
    fonts:
      - asset: packages/firebase_ui_auth/fonts/SocialIcons.ttf
copied to clipboard

Docs #

Find relevant documentation here

Issues and feedback #

434
likes
150
points
29.3k
downloads

Publisher

verified publisherfirebase.google.com

Weekly Downloads

2024.08.04 - 2025.02.16

Pre-built widgets library that are integrated with the variety of the Firebase Auth providers.

Repository (GitHub)
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

email_validator, firebase_auth, firebase_core, firebase_dynamic_links, firebase_ui_localizations, firebase_ui_oauth, firebase_ui_shared, flutter, flutter_localizations, meta

More

Packages that depend on firebase_ui_auth