I would like it to show and hide when eyes are clicked
TextFormField(
keyboardType: TextInputType.visiblePassword,
obscureText: true,
decoration: const InputDecoration(
labelText: "Entrez votre mot de passe",
border: OutlineInputBorder(),
prefixIcon: Icon(Icons.lock),
suffixIcon: Icon(Icons.remove_red_eye),
),
)
I would like it to show and hide when eyes are clicked
2
Answers
Firstly need to declare a bool variable
Then in TextFormField you need to do following things
Make sure that
TextFormField
is inside aStatefulWidget
, create a variablebool isPasswordVisible = false;
and use it as such: