firebase_ui_auth 1.0.0-dev.0 copy "firebase_ui_auth: ^1.0.0-dev.0" to clipboard
firebase_ui_auth: ^1.0.0-dev.0 copied to clipboard

outdated

Firebase UI widgets for authentication

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.

Installation #

flutter pub add firebase_ui_auth

Getting Started #

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';
import 'package:firebase_ui_auth/firebase_ui_auth.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    const providers = [EmailAuthProvider()];

    return MaterialApp(
      initialRoute: FirebaseAuth.instance.currentUser == null ? '/sign-in' : '/profile',
      routes: {
        '/sign-in': (context) {
          return SignInScreen(
            providers: providers,
            actions: [
              AuthStateChangeAction<SignedIn>((context, state) {
                Navigator.pushReplacementNamed(context, '/profile');
              }),
            ],
          );
        },
        '/profile': (context) {
          return ProfileScreen(
            providers: providers,
            actions: [
              SignedOutAction((context) {
                Navigator.pushReplacementNamed(context, '/sign-in');
              }),
            ],
          );
        },
      },
    );
  }
}

Learn more in the Getting started guide.

Roadmap / Features #