Currently I have my password TextFormField
like this:
TextFormField(
decoration: const InputDecoration(
labelText: 'Password',
icon: const Padding(
padding: const EdgeInsets.only(top: 15.0),
child: const Icon(Icons.lock),
)),
validator: (val) => val.length < 6 ? 'Password too short.' : null,
onSaved: (val) => _password = val,
obscureText: true,
);
I want a button like interaction which will make password visible and invisible. Can I do it inside TextFormField
? Or I will have to make a Stack
widget to get my required UI. And how will the condition be made regarding obscureText
true/false?