Skip to content
flutter-auth-ui is an authentication library for flutter web applications. It uses Firebase auth as security as a service (SECaaS) provider. It implements UI to register user, validate email, sign in, sign out, restore password.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib test for token validation Aug 14, 2019

flutter-auth-ui (faui)

faui is an authentication library for flutter web applications. It registers users with email and password using Firebase security as a service ( SECaaS ). The library provides UI to register user, validate email, sign in, sign out and restore password.

The library works with flutter for web tech preview, with intent to switch to production, and to start supporting iOS and Android, as soon as flutter for web gets released.


Explore UX here.

Source code: flutter-auth-ui-demo.

Getting Started

Create Project in Firebase

To test the library use demo project.

apiKey: "AIzaSyA3hshWKqeogfYiklVCCtDaWJW8TfgWgB4"

Then you will want to create your project:

  1. Sign in to firebase console
  2. Add, configure and open project
  3. In the project open tab "Authentication" and then tab "Sign-in Method"
  4. Click "Email/Password", set "Enable" and click "Save"
  5. Select "Project Settings" (gear icon)
  6. Copy your "Web API Key"

Set Dependency

While flitter_web is not published in pub, the packages that depend on it, cannot be published too. So, you need to setup submodule:

  1. Run:
git submodule add ./lib/external/flutter-auth-ui
  1. Update pubspec.yaml to make sure your project references necessary packages:
  http: ^0.12.0+2
  uuid: 2.0.1

  test: any

Update Code

In the beginning of the method build of the widget that requires authentication (it should be stateful), add the code:

if (faui.User == null) {
  return faui.BuildAuthScreen(
    onExit: this.setState((){...}),
    firebaseApiKey: "...",

Packages to import:

import 'package:<your app name>/external/flutter-auth-ui/lib/faui.dart';
import 'package:<your app name>/external/flutter-auth-ui/lib/faui_model.dart';

Get user email:

Sign out:


Silent sign-in:

// Before start:
FauiUser user =
      await faui.TrySignInSilently(firebaseApiKey: XfConfig.FirebaseApiKey);

// After sign in with dialog:

Run Tests

flutter pub run test

You can’t perform that action at this time.