faui 2.0.9

  • Readme
  • Changelog
  • Installing
  • 77

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.

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>

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

Import you need:

import 'package:faui/faui.dart';

Get user email:

fauiUser.email

Sign out:

fauiSignOut()

Silent sign-in:


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

// After sign in with dialog:
fauiSaveUserLocallyForSilentSignIn();

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

Meet Coding Style #

We follow dart styling.

[0.0.1] - Sep 15, 2019

  • Initial release.

[1.0.1] - Sep 15, 2019

  • Fixed package format.

[1.0.2] - Sep 15, 2019

  • Fixed package format.

[1.0.3] - Sep 15, 2019

  • Fixed package format.

[1.0.4] - Sep 16, 2019

  • Fixed package format.

[1.0.5] - Sep 16, 2019

  • Updated documentation.

[1.0.6] - Sep 16, 2019

  • Updated documentation.

[1.0.8] - Oct 16, 2019

  • Fixed bug with tab stop
  • Documented API

[1.0.9] - Oct 16, 2019

  • Updated link to demo

[1.0.10] - Oct 19, 2019

  • Stopped using scaffold to prevent Android issues
  • Started using default theme color for error messages

[1.0.11] - Oct 19, 2019

  • Made class FauiUser public

[1.0.12] - Oct 19, 2019

  • Made class AuthConnector public to enable integration testing

[1.0.14] - Oct 19, 2019

  • Applied default title style to the header

[1.0.15] - Oct 20, 2019

  • Added button 'Close'

[1.0.16] - Oct 20, 2019

  • Fixed background color

[1.0.17] - Oct 23, 2019

  • Layout customization
  • Language customization

[1.0.18] - Oct 24, 2019

  • Added readme.md to 'example'

[1.0.19] - Nov 3, 2019

  • Removed sizes

[2.0.0] - Jan 4, 2020

  • Refactored library to meet Dart coding standards

  • Added Firebase data access

[2.0.1] - Jan 7, 2020

  • Use shared_preferences instead of crypted_preferences

[2.0.2] - Jan 7, 2020

  • Fixed demo

[2.0.3] - Jan 11, 2020

  • Exposed more methods

  • Fixed double password reset email

[2.0.4] - Jan 11, 2020

  • Removed debug logging

[2.0.5] - Jan 11, 2020

  • Separated api methods to faui_api

[2.0.6] - Jan 12, 2020

  • Added method to delete doc

[2.0.7] - Jan 12, 2020

  • Modified db signature

[2.0.8] - Jan 12, 2020

  • Add DB access to faui_api

  • Update readme

[2.0.9] - Jan 12, 2020

  • Published FauiDb

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  faui: ^2.0.9

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:faui/faui.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Format lib/src/90_utility/util.dart.

Run flutter format to format lib/src/90_utility/util.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0-dev.0.1 <3.0.0
flutter 0.0.0
http ^0.12.0+2 0.12.0+4
shared_preferences ^0.5.6 0.5.6
uuid ^2.0.1 2.0.4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
flutter_web_plugins 0.0.0
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
shared_preferences_macos 0.0.1+3
shared_preferences_platform_interface 1.0.1
shared_preferences_web 0.1.2+2
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test any