Browse Source

修改设置

newdev_shunjiawei
tanlongsheng 2 years ago
parent
commit
b980fa21e6
  1. 124
      lib/modules/settings/views/settings_view.dart

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

@ -45,6 +45,8 @@ class SettingsView extends GetView<SettingsController> {
children: [
_buildUserInfoCard(isDarkMode),
SizedBox(height: 20.h),
_buildAISettingsSection(isDarkMode),
SizedBox(height: 20.h),
_buildSystemSettingsSection(isDarkMode),
SizedBox(height: 20.h),
_buildAboutSection(isDarkMode),
@ -142,12 +144,15 @@ class SettingsView extends GetView<SettingsController> {
return Container(
decoration: BoxDecoration(
color: Colors.blue[600],
borderRadius: BorderRadius.circular(30.r),
borderRadius:
BorderRadius.circular(30.r),
),
child: Center(
child: Text(
controller.userInfo.value.name.isNotEmpty
? controller.userInfo.value.name[0]
controller.userInfo.value.name
.isNotEmpty
? controller
.userInfo.value.name[0]
.toUpperCase()
: '?',
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) {
return Column(
@ -370,46 +451,13 @@ class SettingsView extends GetView<SettingsController> {
),
onTap: () {
// 打开备份设置页面
print('---------用户头像-${controller.userInfo.value.avatar}');
print(
'---------用户头像-${controller.userInfo.value.avatar}');
print('---------用户名-${controller.userInfo.value.name}');
//print('user${User.instance.value}');
},
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(
height: 1,
color: isDarkMode

Loading…
Cancel
Save