|
|
@ -149,35 +149,13 @@ class EditProfileView extends GetView<ProfileController> { |
|
|
elevation: 0, |
|
|
elevation: 0, |
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|
|
title: Text( |
|
|
title: Text( |
|
|
'编辑个人资料', |
|
|
'editProfile'.tr, |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 17.sp, |
|
|
fontSize: 17.sp, |
|
|
fontWeight: FontWeight.w600, |
|
|
fontWeight: FontWeight.w600, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
// actions: [ |
|
|
|
|
|
// TextButton( |
|
|
|
|
|
// onPressed: () { |
|
|
|
|
|
// // 保存用户名 |
|
|
|
|
|
// controller.updateUserName(nameController.text); |
|
|
|
|
|
// // 返回上一级页面 |
|
|
|
|
|
// Get.back(); |
|
|
|
|
|
// }, |
|
|
|
|
|
// style: TextButton.styleFrom( |
|
|
|
|
|
// foregroundColor: Colors.blue, // 确保按钮文字颜色 |
|
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 16.w), |
|
|
|
|
|
// ), |
|
|
|
|
|
// child: Text( |
|
|
|
|
|
// '保 存', |
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
// fontSize: 16.sp, |
|
|
|
|
|
// color: isDarkMode ? Colors.blue[300] : Colors.blue, |
|
|
|
|
|
// fontWeight: FontWeight.w500, |
|
|
|
|
|
// ), |
|
|
|
|
|
// ), |
|
|
|
|
|
// ), |
|
|
|
|
|
// ], |
|
|
|
|
|
), |
|
|
), |
|
|
body: Padding( |
|
|
body: Padding( |
|
|
padding: EdgeInsets.all(16.w), |
|
|
padding: EdgeInsets.all(16.w), |
|
|
@ -221,13 +199,27 @@ class EditProfileView extends GetView<ProfileController> { |
|
|
SizedBox(height: 20.h), |
|
|
SizedBox(height: 20.h), |
|
|
|
|
|
|
|
|
// 昵称编辑 - 使用外部定义的controller而不是每次重建 |
|
|
// 昵称编辑 - 使用外部定义的controller而不是每次重建 |
|
|
TextField( |
|
|
Row( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: TextField( |
|
|
controller: nameController, |
|
|
controller: nameController, |
|
|
decoration: const InputDecoration( |
|
|
decoration: InputDecoration( |
|
|
labelText: '昵称', |
|
|
labelText: 'nickname'.tr, |
|
|
border: OutlineInputBorder(), |
|
|
border: OutlineInputBorder(), |
|
|
|
|
|
suffixIcon: nameController.text.isNotEmpty |
|
|
|
|
|
? IconButton( |
|
|
|
|
|
icon: Icon(Icons.clear), |
|
|
|
|
|
onPressed: () { |
|
|
|
|
|
nameController.clear(); |
|
|
|
|
|
}, |
|
|
|
|
|
) |
|
|
|
|
|
: null, |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
// ... 其他编辑项 ... |
|
|
// ... 其他编辑项 ... |
|
|
|
|
|
|
|
|
SizedBox(height: 30.h), |
|
|
SizedBox(height: 30.h), |
|
|
@ -249,7 +241,7 @@ class EditProfileView extends GetView<ProfileController> { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
child: Text( |
|
|
child: Text( |
|
|
'保存', |
|
|
'save'.tr, |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 16.sp, |
|
|
fontSize: 16.sp, |
|
|
color: Colors.white, |
|
|
color: Colors.white, |
|
|
|