Created
April 30, 2021 11:58
-
-
Save ashutoshkrris/1fb5477905ba3fc862fcd8043a44bc88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| class LoginForm extends StatefulWidget { | |
| @override | |
| _LoginFormState createState() => _LoginFormState(); | |
| } | |
| class _LoginFormState extends State<LoginForm> { | |
| bool _isHidden = true; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| backgroundColor: Theme.of(context).secondaryHeaderColor, | |
| body: Center( | |
| child: Padding( | |
| padding: const EdgeInsets.all(20.0), | |
| child: TextField( | |
| obscureText: _isHidden, | |
| decoration: InputDecoration( | |
| hintText: 'Password', | |
| suffixIcon: Icon(Icons.visibility), // Add this line | |
| ), | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment