NearHuscarl / flutter_login

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

How to hide recover password and signup option???? #310

Open fisforfaheem opened 2 years ago

fisforfaheem commented 2 years ago

it would help many who just want t add login functionality

jacentsao commented 2 years ago

use hideForgotPasswordButton to hide recover password

fisforfaheem commented 2 years ago

Can u please show an example if possible

ftapiat commented 2 years ago

You need to pass these 2 properties to the FlutterLogin Widget:

Example Code

return FlutterLogin(
      hideForgotPasswordButton: true,
      onSignup: null,

      logo: AssetImage('assets/images/logo-mph.jpg'),
      userType: LoginUserType.name,
      theme: LoginTheme(
        primaryColor: theme.primaryColor,
      ),
      messages: LoginMessages(
        userHint: "RUT",
        passwordHint: "Contraseña",
        confirmPasswordHint: "Confirmar contraseña",
        loginButton: "Ingresar",
      ),
      userValidator: RUTValidator(validationErrorText: "El RUT no es válido").validator,
      passwordValidator:  (value) {
        if (value == null || value.isEmpty) {
          return 'Debe ingresar una contraseña';
        }
        return null;
      },
      onLogin: _authUser,
      onSubmitAnimationCompleted: () {
        Navigator.of(context).pushReplacement(MaterialPageRoute(
          builder: (context) => DashboardScreen(),
        ));
      },
      onRecoverPassword: _recoverPassword
    );

Result

image