easy_google_sign_in 0.1.0 copy "easy_google_sign_in: ^0.1.0" to clipboard
easy_google_sign_in: ^0.1.0 copied to clipboard

One-liner Google Sign-In for Firebase Auth. Call a single function in onPressed or use the provided button widget.

easy_google_sign_in #

One-liner Google Sign-In for Firebase Auth — just call a function in your button’s onPressed, or use the included EasyGoogleSignInButton.

Why? #

You shouldn’t write boilerplate every time. This package wraps:

  • firebase_auth for Firebase login
  • google_sign_in for mobile tokens
  • Web popup flow for Flutter web

Quick Start #

  1. Add dependencies to your app (the consumer of this package):
dependencies:
  firebase_core: ^3.0.0
  firebase_auth: ^5.0.0
  easy_google_sign_in: ^0.1.0
  1. Do the usual Firebase setup (manual, once per app):
  • Add google-services.json (Android) / GoogleService-Info.plist (iOS)
  • Add SHA-1/SHA-256 for Android in Firebase console (keytool)
  • For Web, add Firebase config (or use FlutterFire CLI)
  • Call Firebase.initializeApp() in main()
  1. Use it:
ElevatedButton(
  onPressed: easyGoogleSignInOnPressed(
    onSuccess: (cred) => print('Welcome ${cred.user?.displayName}!'),
  ),
  child: const Text('Sign in with Google'),
);

or

EasyGoogleSignInButton(
  onSuccess: (cred) => print('Welcome ${cred.user?.email}!'),
)

Sign out #

await signOutFromGoogle();

Options #

EasyGoogleSignInOptions(
  scopes: ['email', 'profile'],
  iosClientId: null,
  hostedDomain: null,
  requestServerAuthCode: false,
  showDefaultLoadingOverlay: true,
)

Notes #

  • This package does not auto-initialize Firebase for you; apps differ.
  • On iOS/macOS, if you use a custom client ID, pass it via iosClientId.
  • On Web we use signInWithPopup.

Notes for google_sign_in v7.x #

This package uses the new v7 API (singleton + initialize() + authenticate()). Only an ID token is provided by the plugin; accessToken is no longer exposed. For Firebase Auth this is sufficient.

0
likes
140
points
124
downloads

Publisher

unverified uploader

Weekly Downloads

One-liner Google Sign-In for Firebase Auth. Call a single function in onPressed or use the provided button widget.

Repository (GitHub)
View/report issues

Topics

#firebase #authentication #google #sign-in #flutter

Documentation

API reference

License

unknown (license)

Dependencies

firebase_auth, firebase_core, flutter, google_sign_in

More

Packages that depend on easy_google_sign_in