Git Product home page Git Product logo

sign_in_flutter's Introduction

Flutter Google Sign In using Firebase

codemagic

Checkout my Medium article "Flutter: Implementing Google Sign In".

In this app, I have implemented Google Sign In using Firebase for both Android and iOS, fixing all the issues with the latest Flutter updates. To understand how to fix all the Firebase issues in Flutter make sure you check out my Medium article.

NOTE: The project is updated to Flutter version 1.12.

Flutter 1.7 updates

With the introduction of Flutter 1.7, the most frustrating thing fixing AndriodX incompatibilities has been taken care of. Now, you can just create a new project using the --androidx flag to ensure the generated project targets the new support library.

Firebase changes

Now, you need to fill the OAuth consent form in order to use Firebase in your app, otherwise your app will just crash. So, make sure you checkout my Medium article.

Using this app

If you want to clone and use this app, then you have to complete the following steps:

Step 1: Generate the SHA-1

Use the following command to generate SHA-1:

keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

Step 2: Complete the Firebase setup

First of all, complete the whole Firebase setup for both Android and iOS. You will get two files while doing the setup, one for each platform. You have to place the google-services.json & GoogleService-Info.plist files in the respective directory of each platform. For more info, check out my Medium article.

NOTE: USE THE SHA-1 GENERATED FROM YOUR SYSTEM

Step 3: Completing the iOS integration

For the iOS part, you have to do one more step. You will find a TODO in Info.plist file, just complete that.

Step 4: Run the app

Now, you can run the app on your device using the command:

flutter run

Screenshots

Plugins

The plugins used in this project are:

  1. "firebase_auth".
  2. "google_sign_in".

Add this to your package's pubspec.yaml file to use Firebase & Google Sign In:

dependencies:
  firebase_auth: ^0.15.4
  google_sign_in: ^4.1.1

Import using:

import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';

License

Copyright (c) 2019 Souvik Biswas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sign_in_flutter's People

Contributors

sbis04 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.