Skip to content

Instantly share code, notes, and snippets.

@Aidanvii7
Last active July 25, 2019 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aidanvii7/9a7e8f2defacebc6f2e8284718c2605e to your computer and use it in GitHub Desktop.
Save Aidanvii7/9a7e8f2defacebc6f2e8284718c2605e to your computer and use it in GitHub Desktop.
Flutter Google sign in
Future<FirebaseUser> login() async {
final googleUser = await _googleSignIn.signIn();
final googleAuth = await googleUser.authentication;
final authCredential = GoogleAuthProvider.getCredential(
idToken: googleAuth.idToken,
accessToken: googleAuth.accessToken
);
return await _firebaseAuth.signInWithCredential(authCredential);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment