NearHuscarl / flutter_login

Provides login screen with login/signup functionalities to help speed up development
MIT License
1.48k stars 788 forks source link

Google Sign in form is unresponsive when called from Flutter Login #450

Closed davoutuk closed 10 months ago

davoutuk commented 10 months ago

I'm using the 'flutter_login' package for the sign-in and sign-up features for my Flutter web app. Under the hood, I'm using Supabase authentication, and the basic email/password login works fine.

I'm now trying to add Google authentication, following the examples in the package docs. However, when I do this, the Google Sign in pop up form appears, but all its controls are unresponsive. It's as though some other part of the web app has the focus and won't allow the Google Sign In form to take input.

image

Here's the refevant code from my web ap...

@override
  Widget build(BuildContext context) {
    return FlutterLogin(
      title: 'Good Day',
      loginProviders: [
        LoginProvider(
          icon: FontAwesomeIcons.google,
          label: 'Google',
          callback: () async {
            await _loginGoogle();
          },
        ),
      ],
      messages: LoginMessages(recoverPasswordDescription: 'You will be sent an email to allow you to reset your password', recoverPasswordButton: 'Reset', recoverPasswordIntro: 'Email address'),
      onLogin: _loginUser,
      onSignup: _signUpUser,
      onRecoverPassword: _resetPassword,
    );
  }

  Future<String?> _loginGoogle() async {
    try {
      await ref.read(authenticationProvider.notifier).loginGoogle();
      return null;
    } catch (e) {
      return e.toString();
    }
  }

Any suggestions on how to fix this?