Answers for "how to create an obscure password in flutter"

3

show password in flutter

TextFormField(
   keyboardType: TextInputType.text,
   controller: _userPasswordController,
   obscureText: !_passwordVisible,//This will obscure text dynamically
   decoration: InputDecoration(
       labelText: 'Password',
       hintText: 'Enter your password',
       // Here is key idea
       suffixIcon: IconButton(
            icon: Icon(
              // Based on passwordVisible state choose the icon
               _passwordVisible
               ? Icons.visibility
               : Icons.visibility_off,
               color: Theme.of(context).primaryColorDark,
               ),
            onPressed: () {
               // Update the state i.e. toogle the state of passwordVisible variable
               setState(() {
                   _passwordVisible = !_passwordVisible;
               });
             },
            ),
          ),
        );
Posted by: Guest on May-10-2021
0

flutter text form field password

enableSuggestions: false,
autocorrect: false,
Posted by: Guest on August-06-2021

Code answers related to "how to create an obscure password in flutter"

Browse Popular Code Answers by Language