Last active
July 25, 2019 12:41
-
-
Save Aidanvii7/9a7e8f2defacebc6f2e8284718c2605e to your computer and use it in GitHub Desktop.
Flutter Google sign in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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