This commit is contained in:
Hillel Coren 2021-05-13 15:05:29 +03:00
parent 50fe5e51aa
commit 0710ec63cd
1 changed files with 14 additions and 10 deletions

View File

@ -149,16 +149,20 @@ class _UserDetailsState extends State<UserDetails>
}); });
} else if (_connectGmailStep == GMAIL_1_SIGN_IN) { } else if (_connectGmailStep == GMAIL_1_SIGN_IN) {
print('## STEP 1'); print('## STEP 1');
GoogleOAuth.grantOfflineAccess((idToken, accessToken, serverAuthCode) { try {
print('## id: $idToken, acces: $accessToken, auth: $serverAuthCode'); GoogleOAuth.grantOfflineAccess((idToken, accessToken, serverAuthCode) {
if (idToken.isEmpty || accessToken.isEmpty) { print('## id: $idToken, acces: $accessToken, auth: $serverAuthCode');
GoogleOAuth.signOut(); if (idToken.isEmpty || accessToken.isEmpty) {
} else { GoogleOAuth.signOut();
setState(() { } else {
_connectGmailStep = GMAIL_2_AUTHORIZE; setState(() {
}); _connectGmailStep = GMAIL_2_AUTHORIZE;
} });
}); }
});
} catch (error) {
showErrorDialog(context: context, message: error);
}
} else if (_connectGmailStep == GMAIL_2_AUTHORIZE) { } else if (_connectGmailStep == GMAIL_2_AUTHORIZE) {
print('## STEP 3'); print('## STEP 3');
final completer = Completer<Null>(); final completer = Completer<Null>();