How to show hide password in TextFormField?

Posted by Jessica Taylor | Updated on

Want to show hide password in TextFormField? First make you widget StatefulWidget if it is a StatelessWidget.Then have a variable bool _obscureText and pass it to your TextFormField. The toggle it with setState as required.

Here is an example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers