When user pushes a button, signInWithGoogle() will be called.

Future<void> signInWithGoogle() async {
    final GoogleSignInAccount? googleUser;
    final GoogleSignInAuthentication googleAuth;

    googleUser = await GoogleSignIn().signIn().catchError((e) {
      context.read<LoginModel>().load(false);    //Have the user login again
    });

    if (googleUser == null) {
      return;
    }

    googleAuth = await googleUser.authentication;

    final OAuthCredential credential = GoogleAuthProvider.credential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );
    await FirebaseAuth.instance.signInWithCredential(credential);

    mainpage.accountCreated();
    context.read<mainpage.UserInfo>().setUser();

    ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
      content: Text("Success"),
    ));

    context.read<mainpage.UserInfo>().getUserInfo();
  }

If signin succeeded, no error has occurs. However if the process canceled, the error below has occured.

throw PlatformException(code: errorCode, message: errorMessage as String?, details: errorDetails, stacktrace: errorStacktrace);

What should I do?