Search packages, repositories and app categories

GitHub repositorydaewu14/google_one_tap_sign_in

google_one_tap_sign_in

Flutter Google One Tap Sign In (Android)

google_one_tap_sign_in project cover
Stars
8
Forks
12
Last push (UTC)
Aug 17, 2025
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

Screenshoot

Google One Tap Sign In

Google One Tap Sign In (Android)

A Flutter Plugin for Google One Tap Sign In

Getting Started

To access Google Sign-In, you'll need to make sure to register your application.

  • Add to your pubspec.yaml

    dependencies:  
      google_one_tap_sign_in: [any]
    
  • Add Google Service

    classpath 'com.google.gms:google-services:[x.x.x]'
    
  • Import plugin

    import 'package:google_one_tap_sign_in/google_one_tap_sign_in.dart';
    
  • Handle Simple Method

    // Your Web Client Id  
    final String _webClientId = "[XXXXXXXXXXX]";
    void _onSignIn() async {
        var data = await GoogleOneTapSignIn.startSignIn(webClientId: _webClientId);
        if (data != null) {
          // Whatever you do with [SignInResult] data
          print("Id Token : ${data.idToken ?? "-"}");
          print("ID : ${data.id ?? "-"}");
        }
    }
    
  • Handle with Condition Method

    // Your Web Client Id  
    final String _webClientId = "[XXXXXXXXXXX]";
    void _onSignInWithHandle() async {
    var result = await GoogleOneTapSignIn.handleSignIn(webClientId: _webClientId);
    
        if (result.isTemporaryBlock) {
          // TODO: Tell your users about this status
          print("Temporary BLOCK");
        }
    
        if (result.isCanceled) {
          // TODO: Tell your users about this status
          print("Canceled");
        }
    
        if (result.isFail) {
          // TODO: Tell your users about this status
        }
    
        if (result.isOk) {
          // TODO: Whatever you do with [SignInResult] data
          print("OK");
          print("Id Token : ${result.data?.idToken ?? "-"}");
          print("Email : ${result.data?.username ?? "-"}");
        }
    }
    

Example

Find the example wiring in the Google One Tap Sign In

Daewu Bintara GitHub avatar
GitHub author

Daewu Bintara ↗

Enjoy life

KirminAjaYK, INDONESIAOfficial website ↗
LanguagesDartKotlin

Packages published by this repository

Dependencies used

Dependency list 3 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}
  • flutter_lintsDevelopment^1.0.0

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗