Browse Source

修改设置

weicu
tanlongsheng 2 years ago
parent
commit
d9c3c56597
  1. 10
      lib/modules/login/views/login_view.dart
  2. 136
      lib/modules/settings/views/settings_view.dart

10
lib/modules/login/views/login_view.dart

@ -171,7 +171,7 @@ class LoginView extends GetView<LoginController> {
); );
} }
// 输入框 // 输入框
Widget _buildInputField(bool isDarkMode) { Widget _buildInputField(bool isDarkMode) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -224,13 +224,13 @@ class LoginView extends GetView<LoginController> {
Expanded( Expanded(
child: TextField( child: TextField(
controller: controller.contactController, controller: controller.contactController,
// keyboardType: controller.selectedCountryFlag == '✉️' // keyboardType: controller.selectedCountryFlag == '✉️'
// ? TextInputType.emailAddress // ? TextInputType.emailAddress
// : TextInputType.phone, // : TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(
hintText: controller.selectedCountryFlag == '✉️' hintText: controller.selectedCountryFlag == '✉️'
? 'email'.tr // 需要在翻译文件中添加 ? 'email'.tr // 需要在翻译文件中添加
: 'phoneNumber'.tr, // 需要在翻译文件中添加 : 'phoneNumber'.tr, // 需要在翻译文件中添加
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: isDarkMode ? Colors.grey[600] : Colors.black38, color: isDarkMode ? Colors.grey[600] : Colors.black38,

136
lib/modules/settings/views/settings_view.dart

@ -45,6 +45,8 @@ class SettingsView extends GetView<SettingsController> {
children: [ children: [
_buildUserInfoCard(isDarkMode), _buildUserInfoCard(isDarkMode),
SizedBox(height: 20.h), SizedBox(height: 20.h),
_buildAISettingsSection(isDarkMode),
SizedBox(height: 20.h),
_buildSystemSettingsSection(isDarkMode), _buildSystemSettingsSection(isDarkMode),
SizedBox(height: 20.h), SizedBox(height: 20.h),
_buildAboutSection(isDarkMode), _buildAboutSection(isDarkMode),
@ -110,12 +112,12 @@ class SettingsView extends GetView<SettingsController> {
// 裁剪圆形头像 // 裁剪圆形头像
borderRadius: BorderRadius.circular(30.r), borderRadius: BorderRadius.circular(30.r),
child: controller.userInfo.value.avatar.isEmpty child: controller.userInfo.value.avatar.isEmpty
? ?
// Image.network( // Image.network(
// 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80', // 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80',
// fit: BoxFit.cover, // 图片填充方式 // fit: BoxFit.cover, // 图片填充方式
// ) // )
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blue[600], color: Colors.blue[600],
borderRadius: BorderRadius.circular(30.r), borderRadius: BorderRadius.circular(30.r),
@ -142,12 +144,15 @@ class SettingsView extends GetView<SettingsController> {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blue[600], color: Colors.blue[600],
borderRadius: BorderRadius.circular(30.r), borderRadius:
BorderRadius.circular(30.r),
), ),
child: Center( child: Center(
child: Text( child: Text(
controller.userInfo.value.name.isNotEmpty controller.userInfo.value.name
? controller.userInfo.value.name[0] .isNotEmpty
? controller
.userInfo.value.name[0]
.toUpperCase() .toUpperCase()
: '?', : '?',
style: TextStyle( style: TextStyle(
@ -266,6 +271,82 @@ class SettingsView extends GetView<SettingsController> {
); );
} }
// AI设置
Widget _buildAISettingsSection(bool isDarkMode) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 4.w, bottom: 8.h),
child: Text(
'AI设置',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w500,
color: isDarkMode ? Colors.blue[400] : Colors.blue[600],
letterSpacing: 1,
),
),
),
Container(
decoration: BoxDecoration(
color: isDarkMode ? Colors.white.withOpacity(0.05) : Colors.white,
borderRadius: BorderRadius.circular(16.r),
boxShadow: [
BoxShadow(
color: isDarkMode
? Colors.black.withOpacity(0.2)
: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(16.r),
child: BackdropFilter(
filter: isDarkMode
? ImageFilter.blur(sigmaX: 5, sigmaY: 5)
: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
child: Column(
children: [
// 语音服务选择
_buildSpeechServiceSetting(isDarkMode),
Divider(
height: 1,
color: isDarkMode
? Colors.white.withOpacity(0.1)
: Colors.grey[200]),
Obx(
() => _buildNavigationSetting(
title: 'timbreService'.tr, // 音色服务
subtitle: 'timbreServiceInfo'.tr, // 选择音色服务
icon: Icons.photo_camera_front_outlined,
iconBgColor: isDarkMode
? Colors.cyan[900]!.withOpacity(0.3)
: Colors.cyan[100]!,
iconColor:
isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!,
value: controller.timbreName.value.tr,
valueStyle: TextStyle(
fontSize: 12.sp,
color: isDarkMode ? Colors.white70 : Colors.grey[500],
),
onTap: () {
Get.toNamed(Routes.timbre);
},
isDarkMode: isDarkMode,
),
),
],
),
),
),
),
],
);
}
// 系统设置部分 // 系统设置部分
Widget _buildSystemSettingsSection(bool isDarkMode) { Widget _buildSystemSettingsSection(bool isDarkMode) {
return Column( return Column(
@ -370,46 +451,13 @@ class SettingsView extends GetView<SettingsController> {
), ),
onTap: () { onTap: () {
// 打开备份设置页面 // 打开备份设置页面
print('---------用户头像-${controller.userInfo.value.avatar}'); print(
'---------用户头像-${controller.userInfo.value.avatar}');
print('---------用户名-${controller.userInfo.value.name}'); print('---------用户名-${controller.userInfo.value.name}');
//print('user${User.instance.value}'); //print('user${User.instance.value}');
}, },
isDarkMode: isDarkMode, isDarkMode: isDarkMode,
), ),
Divider(
height: 1,
color: isDarkMode
? Colors.white.withOpacity(0.1)
: Colors.grey[200]),
// 语音服务选择
_buildSpeechServiceSetting(isDarkMode),
Divider(
height: 1,
color: isDarkMode
? Colors.white.withOpacity(0.1)
: Colors.grey[200]),
Obx(
() => _buildNavigationSetting(
title: 'timbreService'.tr, // 音色服务
subtitle: 'timbreServiceInfo'.tr, // 选择音色服务
icon: Icons.photo_camera_front_outlined,
iconBgColor: isDarkMode
? Colors.cyan[900]!.withOpacity(0.3)
: Colors.cyan[100]!,
iconColor:
isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!,
value: controller.timbreName.value.tr,
valueStyle: TextStyle(
fontSize: 12.sp,
color: isDarkMode ? Colors.white70 : Colors.grey[500],
),
onTap: () {
Get.toNamed(Routes.timbre);
},
isDarkMode: isDarkMode,
),
),
Divider( Divider(
height: 1, height: 1,
color: isDarkMode color: isDarkMode

Loading…
Cancel
Save