Google Sign In Flutter

Updated 28 April 2023

Save

Nowadays in most of the mobile app, it required login. And to log in, we need to signup first, filling the long-form. But we can log in to the app through a Social account, then we don’t need to fill a long form to register into the app. Google Sign in Flutter is one of the ways to log in.

Our Flutter app development company also provides various Social Login compatibility for mobile apps.

In today’s blog, we will see how we can implement Google Sign in Flutter.

Android Integration:

Step1: Register your android application in Firebase from the link.

Step2: Enable the OAuth APIs that you want, using the Google Cloud Platform API manager.

Note: Please fill all required fields in the console for OAuth consent screen. Else you might get APIException errors.

iOS Integration:

Step1: Register your iOS application in Firebase from the link.

Step2: Download GoogleService-Info.plist file, and add in Runner target.

Step3: Add below code in [my_project]/ios/Runner/Info.plist file.

Flutter Code:

Step1: Add below code in package’s pubspec.yaml and run pub get.

Step2: Import the package in your dart code.

Step3: Initialize the GoogleSignIn.

Step4: Use the following code to authenticate in your Dart code.

Please check below the complete code for main.dart file.

Finally run your code and check the result.

Thanks for reading 🙂

For more interesting blogs check out here – https://mobikul.com/blog/

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home