I'm a newbie, so please be gentle .
I'm using VSCode to write a Dart/Flutter app that I want to use Google Oauth on for signing in and subsequently sending emails. I'm using this snippet of code from one of Johannes Milke's video tutorials. isSigned is comes back as true. But currentUser (and everything else) comes back as null. As you can see, I've tried different versions of a print statement to try to see what's going on.
Any ideas on what I'm doing wrong? Thanks ... Jeff
class GoogleAuthApi {
static final _googleSignIn = GoogleSignIn(scopes: ['https://mail.google.com/']);
static Future<GoogleSignInAccount?> signIn() async {
var x = await _googleSignIn.isSignedIn();
var y = _googleSignIn.currentUser;
print('Signed In: ... $x ... $y ');
if (await _googleSignIn.isSignedIn()) {
print('Signed In: await ${_googleSignIn.isSignedIn()} ... ');
print('Current User: await ${_googleSignIn.currentUser}');
return _googleSignIn.currentUser;
} else {
return await _googleSignIn.signIn();
}
}```