@@ -3,11 +3,11 @@ import 'package:e_commerce_app/business_logic/repository/auth_repository/auth_re
3
3
import 'package:e_commerce_app/business_logic/repository/repository.dart' ;
4
4
import 'package:e_commerce_app/business_logic/repository/user_repository/user_repo.dart' ;
5
5
import 'package:firebase_auth/firebase_auth.dart' ;
6
- import 'package:google_sign_in/google_sign_in.dart' ;
6
+ // import 'package:google_sign_in/google_sign_in.dart';
7
7
8
8
class FirebaseAuthRepository implements AuthRepository {
9
9
FirebaseAuth _firebaseAuth = FirebaseAuth .instance;
10
- GoogleSignIn _googleSignIn = GoogleSignIn ();
10
+ // GoogleSignIn _googleSignIn = GoogleSignIn();
11
11
UserRepository _userRepository = FirebaseUserRepository ();
12
12
String _authException = "Authentication Failure" ;
13
13
User get loggedFirebaseUser => _firebaseAuth.currentUser! ;
@@ -48,30 +48,27 @@ class FirebaseAuthRepository implements AuthRepository {
48
48
49
49
/// Starts the Sign In with Google Flow.
50
50
/// Created by NDH
51
- Future <void > logInWithGoogle () async {
52
- try {
53
- final googleUser =
54
- await (_googleSignIn.signIn () as Future <GoogleSignInAccount >);
55
- final googleAuth = await googleUser.authentication;
56
- final credential = GoogleAuthProvider .credential (
57
- accessToken: googleAuth.accessToken,
58
- idToken: googleAuth.idToken,
59
- );
60
- await _firebaseAuth.signInWithCredential (credential);
61
- } on FirebaseAuthException catch (e) {
62
- _authException = e.message.toString ();
63
- }
64
- }
51
+ // Future<void> logInWithGoogle() async {
52
+ // try {
53
+ // final googleUser =
54
+ // await (_googleSignIn.signIn() as Future<GoogleSignInAccount>);
55
+ // final googleAuth = await googleUser.authentication;
56
+ // final credential = GoogleAuthProvider.credential(
57
+ // accessToken: googleAuth.accessToken,
58
+ // idToken: googleAuth.idToken,
59
+ // );
60
+ // await _firebaseAuth.signInWithCredential(credential);
61
+ // } on FirebaseAuthException catch (e) {
62
+ // _authException = e.message.toString();
63
+ // }
64
+ // }
65
65
66
66
bool isLoggedIn () => _firebaseAuth.currentUser != null ;
67
67
68
68
/// Signs out the current user
69
69
/// Created by NDH
70
70
Future <void > logOut () async {
71
- await Future .wait ([
72
- _firebaseAuth.signOut (),
73
- _googleSignIn.signOut (),
74
- ]).catchError ((error) {
71
+ await _firebaseAuth.signOut ().catchError ((error) {
75
72
print (error);
76
73
});
77
74
}
0 commit comments