Answers for "setting new password flutter code"

5

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
1

how to create a password widget in flutter

Choose the same code for Text field
Just above Input Decoration paste the below code
obscureText: true,
enableSuggestions: false,
autocorrect: false,
Posted by: Guest on February-01-2022

Code answers related to "setting new password flutter code"

Browse Popular Code Answers by Language