getSignedInUser method
return the account currently signed in
Implementation
Future<GoogleSignInAccount?> getSignedInUser() {
if (_googleSignIn != null) {
return Future.value(_googleSignIn!.currentUser);
}
// the app starts up we don't have _googleSignIn yet, so attempt to silently
// sign in if the underlying platform still remember the last sign in
try {
return GoogleSignIn()
.signInSilently(suppressErrors: true)
.then((account) => account);
} catch (error) {
return Future.value(null);
}
}