Google Login
A Flutter package for Google sign-in using Firebase.
This package used to sign in to the google by using the authService.signInWithGoogle() method of this package, First you need to add or connect your flutter application with firebase and add the dependency required for this package to run
AuthServiceForGoogle()
import 'package:google_login/google_login_module.dart';
// Instantiate the AuthServiceForGoogle
final authService = AuthServiceForGoogle();
// Call the signInWithGoogle method to initiate the Google sign-in process
authService.signInWithGoogle()
For sign in with Google, this package contains the following dependencies in the yaml file, which must be upgraded in the future.
dependencies:
firebase_auth: ^4.15.2
google_sign_in: ^6.2.0
Add the following to your pubspec.yaml
file to use this package for google login:
dependencies:
google_login: ^1.0.2
Use this package as a library
Run this command:
With Flutter:
$ flutter pub add google_login
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
google_login: ^1.0.2
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:google_login/google_login.dart';
Download details:
Author: Deepanshi-Badwaya