Am doing a TextForm Button with Suffex icoon button , I inteneded to show password only while am pressing the button and when I release it it should go back to password format. I could do it only with onyl press.
this is the code
TextFormField(
obscuringCharacter: '#',
obscureText: passwordVisible,
controller: password,
decoration: InputDecoration(
suffixIcon: IconButton(
icon: const Icon(Icons.remove_red_eye),
onPressed: () {
setState(() {
passwordVisible = !passwordVisible;
});
},
),
I just solved it by adding longpress event