From 307b51e95f7fcda93e8bc5fa7fc7d07f0f181bad Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Tue, 26 Feb 2019 23:31:23 -0600 Subject: [PATCH] Finished Implementation of the google sign in provider and its tests, moved mock class definitions to the end of the file in all tests --- lib/src/resources/google_login_provider.dart | 28 -------------------- 1 file changed, 28 deletions(-) delete mode 100644 lib/src/resources/google_login_provider.dart diff --git a/lib/src/resources/google_login_provider.dart b/lib/src/resources/google_login_provider.dart deleted file mode 100644 index 0e3525f..0000000 --- a/lib/src/resources/google_login_provider.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:async'; - -import 'package:firebase_auth/firebase_auth.dart'; -import 'package:google_sign_in/google_sign_in.dart'; - -class GoogleSignInProvider { - final GoogleSignIn _googleSignIn; - final FirebaseAuth _auth; - - GoogleSignInProvider([GoogleSignIn googleSignIn, FirebaseAuth firebaseAuth]) - : _googleSignIn = googleSignIn ?? GoogleSignIn(), - _auth = firebaseAuth ?? FirebaseAuth.instance; - - Future signIn() async { - final GoogleSignInAccount googleUser = await _googleSignIn.signIn(); - final GoogleSignInAuthentication googleAuth = - await googleUser.authentication; - - final AuthCredential credential = GoogleAuthProvider.getCredential( - accessToken: googleAuth.accessToken, - idToken: googleAuth.idToken, - ); - - final FirebaseUser user = await _auth.signInWithCredential(credential); - print("signed in " + user.displayName); - return user; - } -}