feat(authentication): add google sign in parameter in firebase data source constructor
This commit is contained in:
parent
c7b241de2d
commit
197c5d54e6
@ -19,10 +19,13 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class AuthenticationFirebaseDataSourceImpl
|
||||
extends AuthenticationRemoteDataSource {
|
||||
AuthenticationFirebaseDataSourceImpl({FirebaseAuth? firebaseAuth})
|
||||
: _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance;
|
||||
AuthenticationFirebaseDataSourceImpl(
|
||||
{FirebaseAuth? firebaseAuth, GoogleSignIn? googleSignIn,})
|
||||
: _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance,
|
||||
_googleSignIn = googleSignIn ?? GoogleSignIn();
|
||||
|
||||
final FirebaseAuth _firebaseAuth;
|
||||
final GoogleSignIn _googleSignIn;
|
||||
UserCredential? _latestCreds;
|
||||
|
||||
Account _mapper(User user) => AccountModel(
|
||||
@ -185,7 +188,7 @@ class AuthenticationFirebaseDataSourceImpl
|
||||
Future<Account> signInWithGoogle() async {
|
||||
try {
|
||||
// Trigger the authentication flow
|
||||
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();
|
||||
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
|
||||
|
||||
// Obtain the auth details from the request
|
||||
final GoogleSignInAuthentication? googleAuth =
|
||||
|
Loading…
x
Reference in New Issue
Block a user