Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show/Hide functionality for password field #48

Closed
knvpk opened this issue Apr 15, 2019 · 1 comment
Closed

Show/Hide functionality for password field #48

knvpk opened this issue Apr 15, 2019 · 1 comment

Comments

@knvpk
Copy link

knvpk commented Apr 15, 2019

It a basic need for almost every password should have hide and show button with an eye icon. we have keep in flutter with stack widgets i think. i will try it meanwhile anybody can do a pull request.

@danvick
Copy link
Collaborator

danvick commented Apr 30, 2019

Hi @pavankumarkatakam,

I'm not sure of the necessity of baking this into the package especially because of version 3.0.0 the package has a more configurable UI structure and one can create their own implementation of a toggle. The problem with including our own toggler is that we'll have to decide how it looks which may not be preferable to all.

For instance you can create a Row with a button next to your FormBuilderTextField that will toggle the obscureText attribute. Like so:

Row(
    children: <Widget>[
        Expanded(
            child: FormBuilderTextField(
                attribute: "password",
                obscureText: _showPassword,
                decoration: InputDecoration(labelText: "Password"),
           ),
        ),
        IconButton(
            icon: Icon(Icons.remove_red_eye),
            onPressed: (){
                 setState(() {
                   _showPassword = !_showPassword;
                });
            },
        )
    ],
),

If you still think this will make a good addition to the package let's engage further and see how it can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants