我想知道如何检测用户首次通过我的应用程序进入google(因为我需要询问一些其他信息)。 我的代码:
void _submitGoogle() async {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = await GoogleAuthProvider.getCredential(
idToken: googleAuth.idToken,
accessToken: googleAuth.accessToken,
);
final FirebaseUser user = await _auth.signInWithCredential(credential);
assert(user.email != null);
assert(user.displayName != null);
assert(user.isAnonymous != null);
assert(await user.getIdToken() != null);
}