feat: add password visible button
This commit is contained in:
@@ -23,6 +23,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
final TextEditingController _passwordController = TextEditingController();
|
||||
final TextEditingController _codeController = TextEditingController();
|
||||
|
||||
bool _passwordNotVisible = true;
|
||||
bool _isButtonEnabled = true;
|
||||
int _seconds = 60;
|
||||
Timer? _timer;
|
||||
@@ -228,9 +229,21 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.lock_outlined),
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(_passwordNotVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off),
|
||||
onPressed: () {
|
||||
setState(
|
||||
() {
|
||||
_passwordNotVisible = !_passwordNotVisible;
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
labelText: '密碼',
|
||||
),
|
||||
obscureText: true,
|
||||
obscureText: _passwordNotVisible,
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user