firebase_ui_fork 0.0.18

  • Readme
  • Changelog
  • Example
  • Installing
  • 30

firebase_ui #

Build Status pub package

Fork of https://pub.dartlang.org/packages/flutter_firebase_ui

Old package wasnt being maintained so i created this one to update;

firebase_ui is a library that help you to quickly implement firebase authentication. It provider UI for the common identity providers, Facebook, Google, Twitter and email.

Note: this plugin use firebase_auth you must configure it as describe here.

screenshot

Show firebase ui example.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.0.13] - 19/12/2018 #

  • update dependencies
  • add twitter

[0.0.12] - 27/09/2018 #

  • after trouble sign in pop

[0.0.11] - 27/09/2018 #

  • add function signOutProviders

[0.0.10] - 26/09/2018 #

  • fixed empty null on Providers
  • allow for usage with landscape orientation

[0.0.9] - 07/09/2018 #

  • add mail verification option

[0.0.8] - 17/07/2018 #

  • improve UI

[0.0.7] - 04/07/2018 #

  • fixe sign in with mail

[0.0.6] - 30/05/2018 #

  • improve show dialog error

[0.0.5] - 29/05/2018 #

  • show error occured on unknown errors
  • display email if no displayName (example)
  • secure providers test, firebase_auth behavior change
  • pop sign up !

[0.0.4] - 09/05/2018 #

  • Upgrade to Google Services 3.2.1 and Google Sign In 3.0.3

[0.0.3] - 23/03/2018 #

  • dart 2 fix

[0.0.2] - 20/03/2018 #

  • improve ui
  • change firebase_auth version

[0.0.1] - 19/03/2018 #

  • initial release

example/lib/main.dart

import 'dart:async';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:firebase_ui/firebase_ui.dart';
import 'package:firebase_ui/l10n/localization.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        FFULocalizations.delegate,
      ],
      supportedLocales: [
        const Locale('fr', 'FR'),
        const Locale('en', 'US'),
        const Locale('de', 'DE'),
        const Locale('pt', 'BR'),
        const Locale('es', 'MX'),
      ],
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final FirebaseAuth _auth = FirebaseAuth.instance;
  StreamSubscription<FirebaseUser> _listener;

  FirebaseUser _currentUser;

  @override
  void initState() {
    super.initState();
    _checkCurrentUser();
  }

  @override
  void dispose() {
    _listener.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (_currentUser == null) {
      return new SignInScreen(
        title: "Bienvenue",
        header: new Padding(
          padding: const EdgeInsets.symmetric(vertical: 16.0),
          child: new Padding(
            padding: const EdgeInsets.all(16.0),
            child: new Text("Demo"),
          ),
        ),
        providers: [
          ProvidersTypes.google,
          ProvidersTypes.facebook,
          ProvidersTypes.twitter,
          ProvidersTypes.email
        ],
        twitterConsumerKey: "",
        twitterConsumerSecret: "",
      );
    } else {
      return new HomeScreen(user: _currentUser);
    }
  }

  void _checkCurrentUser() async {
    _currentUser = await _auth.currentUser();
    _currentUser?.getIdToken(refresh: true);

    _listener = _auth.onAuthStateChanged.listen((FirebaseUser user) {
      setState(() {
        _currentUser = user;
      });
    });
  }
}

class HomeScreen extends StatelessWidget {
  final FirebaseUser user;

  HomeScreen({this.user});

  @override
  Widget build(BuildContext context) => new Scaffold(
      appBar: new AppBar(
        title: new Text("Bienvenue"),
        elevation: 4.0,
      ),
      body: new Container(
          padding: const EdgeInsets.all(16.0),
          decoration: new BoxDecoration(color: Colors.amber),
          child: new Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new Text("Welcome,"),
                ],
              ),
              new SizedBox(
                height: 8.0,
              ),
              new Text(user.displayName ?? user.email),
              new SizedBox(
                height: 32.0,
              ),
              new RaisedButton(
                  child: new Text("DECONNEXION"), onPressed: _logout)
            ],
          )));

  void _logout() {
    signOutProviders();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_ui_fork: ^0.0.18

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:firebase_ui_fork/email_view.dart';
import 'package:firebase_ui_fork/flutter_firebase_ui.dart';
import 'package:firebase_ui_fork/l10n/localization.dart';
import 'package:firebase_ui_fork/l10n/translations.dart';
import 'package:firebase_ui_fork/login_view.dart';
import 'package:firebase_ui_fork/password_view.dart';
import 'package:firebase_ui_fork/sign_up_view.dart';
import 'package:firebase_ui_fork/trouble_signin.dart';
import 'package:firebase_ui_fork/utils.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
30
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/email_view.dart.

Run flutter format to format lib/email_view.dart.

Format lib/utils.dart.

Run flutter format to format lib/utils.dart.

Maintenance issues and suggestions

Prefer published dependencies. (-100 points)

The source code in a git repository is mutable and could disappear.

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (firebase_auth, flutter_facebook_login).

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: flutter_twitter_login.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
firebase_auth ^0.8.4 0.8.4+5 0.15.5+3
flutter 0.0.0
flutter_facebook_login ^2.0.0 2.0.1 3.0.0
flutter_twitter_login 1.1.0
google_sign_in ^4.0.1+3 4.4.1
Transitive dependencies
collection 1.14.11 1.14.12
firebase_core 0.3.4 0.4.4+3
flutter_web_plugins 0.0.0
google_sign_in_platform_interface 1.1.0
google_sign_in_web 0.8.4 0.9.0
js 0.6.1+1
matcher 0.12.6
meta 1.1.8
path 1.6.4
quiver 2.1.3
sky_engine 0.0.99
stack_trace 1.9.3
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test