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) {
print('## STEP 1');
GoogleOAuth.grantOfflineAccess((idToken, accessToken, serverAuthCode) {
print('## id: $idToken, acces: $accessToken, auth: $serverAuthCode');
if (idToken.isEmpty || accessToken.isEmpty) {
GoogleOAuth.signOut();
} else {
setState(() {
_connectGmailStep = GMAIL_2_AUTHORIZE;
});
}
});
try {
GoogleOAuth.grantOfflineAccess((idToken, accessToken, serverAuthCode) {
print('## id: $idToken, acces: $accessToken, auth: $serverAuthCode');
if (idToken.isEmpty || accessToken.isEmpty) {
GoogleOAuth.signOut();
} else {
setState(() {
_connectGmailStep = GMAIL_2_AUTHORIZE;
});
}
});
} catch (error) {
showErrorDialog(context: context, message: error);
}
} else if (_connectGmailStep == GMAIL_2_AUTHORIZE) {
print('## STEP 3');
final completer = Completer<Null>();