Compare commits

...

2 Commits

Author SHA1 Message Date
JingChiang
781d8dfcdf feat: 新增修改資料密碼顯示按鈕 2024-09-08 21:35:05 +08:00
JingChiang
399f880054 style: code format 2024-09-08 21:32:52 +08:00

View File

@@ -14,13 +14,11 @@ class PersonalInfo extends StatefulWidget {
}
class _PersonalInfoState extends State<PersonalInfo> {
String _name = '',
_phone = '',
_gender = '',
_address = '',
_email = '',
_password = '';
String _name = '', _phone = '', _gender = '', _address = '', _email = '', _password = '';
bool _isEditing = false; //是否為編輯狀態
bool _passwordNotVisible = true;
final TextEditingController _nameController = TextEditingController();
final TextEditingController _phoneController = TextEditingController();
final TextEditingController _genderController = TextEditingController();
@@ -158,8 +156,6 @@ class _PersonalInfoState extends State<PersonalInfo> {
));
}
//頁面
//頁面
@override
Widget build(BuildContext context) {
@@ -257,6 +253,20 @@ class _PersonalInfoState extends State<PersonalInfo> {
subtitle: _isEditing
? TextField(
controller: _passwordController,
obscureText: _passwordNotVisible,
decoration: InputDecoration(
suffixIcon: IconButton(
icon: Icon(_passwordNotVisible
? Icons.visibility
: Icons.visibility_off),
onPressed: () {
setState(
() {
_passwordNotVisible = !_passwordNotVisible;
},
);
},
)),
onChanged: (value) {
setState(() {
_password = value;