Answers for "flutter textfield show password"

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
0

show password in flutter

@override
  void initState() {
    _passwordVisible = false;
  }
Posted by: Guest on May-10-2021

Code answers related to "flutter textfield show password"

Browse Popular Code Answers by Language