faui 2.0.33 copy "faui: ^2.0.33" to clipboard
faui: ^2.0.33 copied to clipboard

Authentication UI and data access for Flutter. Uses Firebase auth as security provider.

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. Supports silent sign in and access to Firestore.

Demos #

Sign in on application load

Sign in on button click

Custom layout and phrasing

Use token to access Firestore

Find the source code here

Pub package

Demo source code

Package source code

Usage #

Create Project in Firebase #

If you want to test the library, use the demo project:

apiKey: "AIzaSyA3hshWKqeogfYiklVCCtDaWJW8TfgWgB4"

To create your own Firebase 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 #

Update pubspec.yaml to make sure your project references necessary packages:

dependencies:
  ...
  faui: <latest version>
copied to clipboard

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 (fauiUser == null) {
  return fauiBuildAuthScreen(
    onExit: this.setState((){...}),
    firebaseApiKey: "...",
  );
}
copied to clipboard

Import you need:

import 'package:faui/faui.dart';
copied to clipboard

Get user email:

fauiUser.email
copied to clipboard

Sign out:

fauiSignOut()
copied to clipboard

Silent sign-in:


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

// After sign in with dialog:
fauiSaveUserLocallyForSilentSignIn();
copied to clipboard

Custom Layout and Language #

To customize UI and/or language, invoke fauiBuildCustomAuthScreen instead of fauiBuildAuthScreen.

See the demo for the details.

Use the Retrieved Token to Access Your Data to Firestore #

Configure basic security rules for your Firestore database. Then utilize the class FauiDbAccess.

See the demo for the details.

Contribute #

Run Tests #

flutter pub run test
copied to clipboard

Meet Coding Style #

We follow dart styling.

11
likes
40
points
148
downloads

Publisher

verified publisherjob-chat.com

Weekly Downloads

2024.10.02 - 2025.04.16

Authentication UI and data access for Flutter. Uses Firebase auth as security provider.

Repository (GitHub)

License

Apache-2.0 (license)

Dependencies

flutter, http, shared_preferences, uuid

More

Packages that depend on faui