Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Allows you to quickly connect common Firebase auth with basic UI

License

Notifications You must be signed in to change notification settings

manhinhang/flutter_fireauth_ui

Repository files navigation

fireauth_ui

Build Status pub package

Allows you to quickly connect common Firebase auth with basic UI.

Support Sign-in Providers List

Sign in method Support
Email
Phone
Google
Play Games
Facebook
Twitter
Github

Support language

  • English

  • Chinses (Tranditional)

Email sign in demo screen

email_demo_video

Installation

Add to your pubspec dependencies:

fireauth_ui: ^0.0.1

Please follow below guides to setup.

  1. Open Firebase Console ( https://console.firebase.google.com/ )

  2. Create your project

  3. Add Firebase to your iOS app

    • Open "ios/Runner.xcworkspace"

    • Drag that "GoogleService-Info.plist" into the Runner directory then dialog will show up and ask you to select the targets, select the Runner target

  4. Add Firebase to your Android app

    • Place "google-services.json" in "android/app" folder

    • If your project required "Google Sign in", please ensure config "Debug signing certificate SHA-1" also.

      You can run this command to get SHA-1 hash from android debug keystore Noted: debug keystore password is "android"

      keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
      
    • Open "android/build.gradle"

      buildscript {
          dependencies {
              // Add this line
              classpath 'com.google.gms:google-services:3.2.1'
          }
      }
    • Open "android/app/build.gradle"

      dependencies {
          // Add this line
          compile 'com.google.firebase:firebase-core:16.0.0'
      }
      ...
      // Add to the bottom of the file
      apply plugin: 'com.google.gms.google-services'
      
  5. Go to "Authentication" Section

  6. Select Sign-in method

  7. Enable "Sign-in providers" which you need, please see support list

    • Email Sign in

      • Just enable it
    • Google Sign-in

      • Add the CFBundleURLTypes attributes below into the "/ios/Runner/Info.plist" file.
      <key>CFBundleURLTypes</key>
      <array>
          <dict>
              <key>CFBundleTypeRole</key>
              <string>Editor</string>
              <key>CFBundleURLSchemes</key>
              <array>
                  <!-- TODO Replace this value: -->
                  <!-- Copied from GoogleServices-Info.plist key REVERSE_CLIENT_ID -->
                  <string>com.googleusercontent.apps.861823949799-vc35cprkp249096uujjn0vvnmcvjppkn</string>
              </array>
          </dict>
      </array>
    • Facebook Sign-in

      • Open https://developers.facebook.com/

      • Click My App then select Add New App

      • In Facebook Login section, click Setup

      • Follow instruction in facebook developer page to setup iOS and Android

      Take care when paste facebook's CFBundleURLTypes into plist
      Don't overwrite Google Sign-in CFBundleURLTypes

      • Finally, remember copy OAuth redirect URI to Firebase's facebook sign-in

        Paste URI in Facebook Login > Settings > Valid OAuth Refirect URIs

Getting Started

Add the following import to your Dart code:

import 'package:fireauth_ui/fireauth_ui.dart';

You can install packages from the command line:

with Flutter:

flutter packages get

Sample code show you how to present sign in page

Navigator.push(
      context,
      new MaterialPageRoute(
          builder: (context) => new FireAuthUISignInPage(
                providers: [
                    FireAuthUIProvider.Email,
                    FireAuthUIProvider.Facebook,
                    FireAuthUIProvider.Google,
                ],
              )),
    );

Dependencies

flutter_facebook_login

firebase_auth

google_sign_in

Credit

  • frmunozr10
    • Spanish and Catalan language support enhancement

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.