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.

License

Notifications You must be signed in to change notification settings

jason-dgio/flutter-auth-ui

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter-auth-ui (faui)

faui is an authentication UI for Flutter. 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. Also it supports silent sign in.

faui is regularly tested for Web by polina-c.

If you regularly test the library for one of the platforms, say this here, please.

Links

Demo1 - default layout and phrasing

Demo2 - custom layout and phrasing

Pub package

Demo source code

Package source code

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 https://console.firebase.google.com/
  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

  1. Update pubspec.yaml to make sure your project references necessary packages:
dependencies:
  ...
  faui: <latest version>

Check <latest version> here.

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: "...",
  );
}

Import:

import 'package:faui/faui.dart';

Get user email:

faui.user.email

Sign out:

faui.signOut()

Silent sign-in:


// Before runApp:
WidgetsFlutterBinding.ensureInitialized();
await faui.trySignInSilently(firebaseApiKey: '...');
...

// After sign in with dialog:
faui.saveUserLocallyForSilentSignIn();

Custom Layout and Language

To customize UI and/or language, invoke buildCustomAuthScreen instead of buildAuthScreen. See demo2 for details.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 98.8%
  • HTML 1.2%