NearHuscarl / flutter_login

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

Login provider button background color not changing!! #482

Closed Tristannos closed 8 months ago

Tristannos commented 8 months ago

I have changed all the theme items in the application and in the flutter_login widget with button color to my primary color. the color is blue but for some reason the Login provider buttons still show purple (from the example)

When I change the button theme the colours should turn to the set color. Or even better let me set a color for each Login provider button, so I can make apple black and google white for example.

return FlutterLogin(
      logo: AssetImage('assets/logo_name.png'),
      onLogin: _authUser,
      onSignup: _signupUser,
      onRecoverPassword: _recoverPassword,
      onConfirmRecover: _confirmRecoverPassword,
      onConfirmSignup: _confirmSignUp,
      onSubmitAnimationCompleted: () {
        Navigator.pushReplacement<void, void>(
          context,
          MaterialPageRoute<void>(
            builder: (BuildContext context) => MainPage(),
          ),
        );
      },
      loginProviders: [
        LoginProvider(
          icon: FontAwesomeIcons.apple,
          label: "Apple",
          animated: false,
          callback: () async {
            // var success = await userAuth.signInWithApple();
            //
            // if(success != null){
            //   await AuthController.loginSucces();
            //   return null;
            // }
            return "Inlog gegevens kloppen niet!";
          },
        ),
        LoginProvider(
          icon: FontAwesomeIcons.google,
          // button: Buttons.google,
          label: "Google",
          callback: () async {
            // var success = await userAuth.signInWithGoogle();
            //
            // if(success != null){
            //   await AuthController.loginSucces();
            //   return null;
            // }
            return "Inlog gegevens kloppen niet!";
          },
        ),
      ],
      loginAfterSignUp: false,
      userType: LoginUserType.email,
      messages: LoginMessages(
        userHint: "Email",
        passwordHint: "Wachtwoord",
        confirmPasswordHint: "Bevestig wachtwoord",
        forgotPasswordButton: "Wachtwoord vergeten",
        signUpSuccess: "Account aangemaakt",
        loginButton: "LOGIN",
        signupButton: "REGISTREREN",
        recoverPasswordButton: "RESETTEN",
        recoverPasswordIntro: "Vul uw email adres in om uw wachtwoord opnieuw in te stellen.",
        recoverPasswordDescription: "Binnen enkele minuten krijgt u een mail.",
        recoverCodePasswordDescription: "We sturen u een wachtwoord code via de mail.",
        goBackButton: "TERUG",
        confirmPasswordError: "Wachtwoord komt niet overeen",
        recoverPasswordSuccess: "Email is verstuurd",
        confirmSignupIntro: "Een verificatie code is verstuurd naar uw email adres.",
        confirmationCodeHint: "Verificatie code",
        confirmationCodeValidationError: "Verificatie code is leeg",
        resendCodeButton: "Opnieuw versturen",
        resendCodeSuccess: "Email is verstuurd",
        confirmSignupButton: "BEVESTIGEN",
        confirmSignupSuccess: "Account geverifieerd",
        confirmRecoverSuccess: "Wachtwoord hersteld",
        confirmRecoverIntro: "De herstelcode om een nieuw wachtwoord in te stellen is naar jouw e-mailadres gestuurd.",
        recoveryCodeHint: "Herstel code",
        recoveryCodeValidationError: "Herstel code is leeg",
        setPasswordButton: "ZET WACHTWOORD",
        flushbarTitleError: "Fout",
        flushbarTitleSuccess: "Link is verstuurd",
        providersTitleFirst: "Of login met",
      ),
      theme: LoginTheme(
          // pageColorDark: backgroundColor,
          // pageColorLight: primaryColor,
          bodyStyle: GoogleFonts.roboto(
            color: textColor,
            fontSize: 14,
            fontWeight: FontWeight.w600,
          ),
          textFieldStyle: GoogleFonts.roboto(
              color: Colors.white
          ),
          buttonStyle: GoogleFonts.roboto(
            color: textColorInPrimary,
            fontWeight: FontWeight.bold,
          ),
          primaryColor: primaryColor,
          accentColor: primaryColor,
          primaryColorAsInputLabel: true,
          inputTheme: InputDecorationTheme(
            filled: true,
            focusColor: primaryColor,
            labelStyle: GoogleFonts.roboto(
              color: textColor,
            ),
            fillColor: backgroundColor,
            iconColor: primaryColor,
            prefixIconColor: primaryColor,
            border: OutlineInputBorder(
              borderRadius: BorderRadius.circular(15),
              borderSide: BorderSide(
                width: 2,
                style: BorderStyle.solid,
                color: backgroundColorAccent,
              ),
            ),
            focusedBorder: OutlineInputBorder(
              borderRadius: BorderRadius.circular(15),
              borderSide: BorderSide(
                width: 2,
                style: BorderStyle.solid,
                color: backgroundColorAccent,
              ),
            ),
            // prefixIconColor: primaryColor,
          ),
          cardTheme: CardTheme(
              color: backgroundColor,
              surfaceTintColor: backgroundColor,
              elevation: 10
          ),
          buttonTheme: LoginButtonTheme(
            backgroundColor: primaryColor,
            highlightColor: primaryColor,
            splashColor: primaryColor,

          ),
      ),
    );

Information (please complete the following information):

image
ErikEPSza commented 2 months ago

What happened? is there a way to change the colours now?