flutter_login icon indicating copy to clipboard operation
flutter_login copied to clipboard

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

Open fisforfaheem opened this issue 2 years ago • 3 comments

it would help many who just want t add login functionality

fisforfaheem avatar Feb 23 '22 08:02 fisforfaheem

use hideForgotPasswordButton to hide recover password

jacentsao avatar Mar 10 '22 01:03 jacentsao

Can u please show an example if possible

fisforfaheem avatar Apr 04 '22 09:04 fisforfaheem

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

  • hideForgotPasswordButton: true
  • onSignup: null

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

ftapiat avatar May 10 '22 01:05 ftapiat