initial for web

This commit is contained in:
Ricardo Markiewicz
2020-07-12 16:43:48 -03:00
parent 05af2678a1
commit ce541cea23
6 changed files with 358 additions and 161 deletions
+6 -4
View File
@@ -18,7 +18,8 @@ class LoginState with ChangeNotifier {
LoginState({
@required SharedPreferences preferences,
@required FirebaseAuth firebaseAuth,
AuthenticationProviderFactory authenticationProviderFactory = const AuthenticationProviderFactory(),
AuthenticationProviderFactory authenticationProviderFactory =
const AuthenticationProviderFactory(),
}) {
_prefs = preferences;
_auth = firebaseAuth;
@@ -42,9 +43,10 @@ class LoginState with ChangeNotifier {
var authCredentials = await _authenticationProvider.handleSignIn();
if (authCredentials != null) {
_user = await _auth.signInWithCredential(
authCredentials);
var authResult = await _auth.signInWithCredential(authCredentials);
if (authResult != null) {
_user = authResult.user;
}
if (_user != null) {
print("signed in " + _user.displayName);
}