|
|
|
@ -1,6 +1,7 @@ |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'dart:ui'; |
|
|
|
import '../controllers/settings_controller.dart'; |
|
|
|
import '../../../core/widgets/common_bottom_nav.dart'; |
|
|
|
import '../../../core/routes/app_routes.dart'; |
|
|
|
@ -10,33 +11,38 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
|
|
|
|
return Scaffold( |
|
|
|
backgroundColor: Colors.grey[50], |
|
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.grey[50], |
|
|
|
appBar: AppBar( |
|
|
|
backgroundColor: Colors.white, |
|
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|
|
|
elevation: 0.5, |
|
|
|
title: Text( |
|
|
|
'设置', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 17.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: Colors.black, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
centerTitle: true, |
|
|
|
leading: IconButton( |
|
|
|
icon: const Icon(Icons.arrow_back_ios, color: Colors.black54), |
|
|
|
icon: Icon( |
|
|
|
Icons.arrow_back_ios, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54 |
|
|
|
), |
|
|
|
onPressed: () => Get.back(), |
|
|
|
), |
|
|
|
), |
|
|
|
body: ListView( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), |
|
|
|
children: [ |
|
|
|
_buildUserInfoCard(), |
|
|
|
_buildUserInfoCard(isDarkMode), |
|
|
|
SizedBox(height: 20.h), |
|
|
|
_buildSystemSettingsSection(), |
|
|
|
_buildSystemSettingsSection(isDarkMode), |
|
|
|
SizedBox(height: 20.h), |
|
|
|
_buildAboutSection(), |
|
|
|
_buildAboutSection(isDarkMode), |
|
|
|
SizedBox(height: 50.h), |
|
|
|
], |
|
|
|
), |
|
|
|
@ -45,128 +51,146 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
} |
|
|
|
|
|
|
|
// 用户信息卡片 |
|
|
|
Widget _buildUserInfoCard() { |
|
|
|
Widget _buildUserInfoCard(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: const LinearGradient( |
|
|
|
colors: [Color(0xFFE3F2FD), Color(0xFFF3E5F5)], |
|
|
|
gradient: LinearGradient( |
|
|
|
colors: isDarkMode |
|
|
|
? [ |
|
|
|
const Color(0xFF1A1A1A).withOpacity(0.7), |
|
|
|
const Color(0xFF2A2A2A).withOpacity(0.7) |
|
|
|
] |
|
|
|
: [ |
|
|
|
const Color(0xFFE3F2FD), |
|
|
|
const Color(0xFFF3E5F5) |
|
|
|
], |
|
|
|
begin: Alignment.topLeft, |
|
|
|
end: Alignment.bottomRight, |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
color: isDarkMode |
|
|
|
? Colors.black.withOpacity(0.2) |
|
|
|
: Colors.black.withOpacity(0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: 60.w, |
|
|
|
height: 60.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.1), |
|
|
|
blurRadius: 8, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
child: BackdropFilter( |
|
|
|
filter: isDarkMode ? ImageFilter.blur(sigmaX: 10, sigmaY: 10) : ImageFilter.blur(sigmaX: 0, sigmaY: 0), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: 60.w, |
|
|
|
height: 60.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.1), |
|
|
|
blurRadius: 8, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
child: Image.network( |
|
|
|
'https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80', |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 16.w), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'林美珍', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: Colors.black87, |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(30.r), |
|
|
|
child: Image.network( |
|
|
|
'https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80', |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Row( |
|
|
|
), |
|
|
|
SizedBox(width: 16.w), |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.h), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.blue[600], |
|
|
|
borderRadius: BorderRadius.circular(10.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
'高级会员', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
Text( |
|
|
|
'林美珍', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Flexible( |
|
|
|
child: Text( |
|
|
|
'已连接设备: DeepVoice Pro', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.h), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.blue[600], |
|
|
|
borderRadius: BorderRadius.circular(10.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
'高级会员', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Flexible( |
|
|
|
child: Text( |
|
|
|
'已连接设备: DeepVoice Pro', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Text( |
|
|
|
'账号ID: deepvoice_834291', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Text( |
|
|
|
'账号ID: deepvoice_834291', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: 32.w, |
|
|
|
height: 32.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode |
|
|
|
? Colors.white.withOpacity(0.1) |
|
|
|
: Colors.white.withOpacity(0.7), |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
blurRadius: 4, |
|
|
|
offset: const Offset(0, 1), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
width: 32.w, |
|
|
|
height: 32.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white.withOpacity(0.7), |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
blurRadius: 4, |
|
|
|
offset: const Offset(0, 1), |
|
|
|
child: Icon( |
|
|
|
Icons.edit, |
|
|
|
size: 16.w, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.grey[600], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Icon( |
|
|
|
Icons.edit, |
|
|
|
size: 16.w, |
|
|
|
color: Colors.grey[600], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// 系统设置部分 |
|
|
|
Widget _buildSystemSettingsSection() { |
|
|
|
Widget _buildSystemSettingsSection(bool isDarkMode) { |
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
@ -177,100 +201,156 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: Colors.blue[600], |
|
|
|
color: isDarkMode ? Colors.blue[400] : Colors.blue[600], |
|
|
|
letterSpacing: 1, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
color: isDarkMode ? Colors.white.withOpacity(0.05) : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
color: isDarkMode |
|
|
|
? Colors.black.withOpacity(0.2) |
|
|
|
: Colors.black.withOpacity(0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
// 通知设置 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '通知设置', |
|
|
|
subtitle: '管理应用推送和提醒', |
|
|
|
icon: Icons.notifications_none, |
|
|
|
iconBgColor: Colors.indigo[100]!, |
|
|
|
iconColor: Colors.indigo[600]!, |
|
|
|
onTap: () { |
|
|
|
// 打开通知设置页面 |
|
|
|
}, |
|
|
|
), |
|
|
|
const Divider(height: 1), |
|
|
|
|
|
|
|
// 备份与恢复 |
|
|
|
_buildNavigationSetting( |
|
|
|
title: '备份与恢复', |
|
|
|
subtitle: '备份设置和AI互动历史', |
|
|
|
icon: Icons.cloud_upload_outlined, |
|
|
|
iconBgColor: Colors.cyan[100]!, |
|
|
|
iconColor: Colors.cyan[600]!, |
|
|
|
value: '上次备份: 今天', |
|
|
|
valueStyle: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.grey[500], |
|
|
|
), |
|
|
|
onTap: () { |
|
|
|
// 打开备份设置页面 |
|
|
|
}, |
|
|
|
), |
|
|
|
const Divider(height: 1), |
|
|
|
|
|
|
|
// 隐私设置 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '隐私设置', |
|
|
|
subtitle: '管理数据收集和权限', |
|
|
|
icon: Icons.shield_outlined, |
|
|
|
iconBgColor: Colors.purple[100]!, |
|
|
|
iconColor: Colors.purple[600]!, |
|
|
|
onTap: () { |
|
|
|
// 打开隐私设置页面 |
|
|
|
}, |
|
|
|
), |
|
|
|
const Divider(height: 1), |
|
|
|
|
|
|
|
// 退出登录 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '退出登录', |
|
|
|
icon: Icons.logout, |
|
|
|
iconBgColor: Colors.red[50]!, |
|
|
|
iconColor: Colors.red[600]!, |
|
|
|
titleColor: Colors.red[600]!, |
|
|
|
onTap: () { |
|
|
|
// 退出登录确认对话框 |
|
|
|
Get.dialog( |
|
|
|
AlertDialog( |
|
|
|
title: const Text('退出登录'), |
|
|
|
content: const Text('确定要退出当前账号吗?'), |
|
|
|
actions: [ |
|
|
|
TextButton( |
|
|
|
onPressed: () => Get.back(), |
|
|
|
child: const Text('取消'), |
|
|
|
), |
|
|
|
TextButton( |
|
|
|
onPressed: () { |
|
|
|
Get.back(); |
|
|
|
controller.signOut(); |
|
|
|
}, |
|
|
|
child: const Text('确定'), |
|
|
|
), |
|
|
|
], |
|
|
|
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: [ |
|
|
|
// 通知设置 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '通知设置', |
|
|
|
subtitle: '管理应用推送和提醒', |
|
|
|
icon: Icons.notifications_none, |
|
|
|
iconBgColor: isDarkMode ? Colors.indigo[900]!.withOpacity(0.3) : Colors.indigo[100]!, |
|
|
|
iconColor: isDarkMode ? Colors.indigo[300]! : Colors.indigo[600]!, |
|
|
|
titleColor: isDarkMode ? Colors.white : null, |
|
|
|
subtitleColor: isDarkMode ? Colors.white70 : null, |
|
|
|
onTap: () { |
|
|
|
// 打开通知设置页面 |
|
|
|
}, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
), |
|
|
|
Divider(height: 1, color: isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[200]), |
|
|
|
|
|
|
|
// 主题设置 |
|
|
|
Obx(() => _buildToggleSetting( |
|
|
|
title: '暗黑模式', |
|
|
|
subtitle: '切换应用的明暗主题', |
|
|
|
icon: controller.isDarkMode.value ? Icons.dark_mode : Icons.light_mode, |
|
|
|
iconBgColor: controller.isDarkMode.value |
|
|
|
? Colors.indigo[900]!.withOpacity(0.3) |
|
|
|
: Colors.amber[100]!, |
|
|
|
iconColor: controller.isDarkMode.value |
|
|
|
? Colors.indigo[300]! |
|
|
|
: Colors.amber[600]!, |
|
|
|
value: controller.isDarkMode.value, |
|
|
|
onChanged: (value) { |
|
|
|
controller.toggleTheme(); |
|
|
|
}, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
)), |
|
|
|
Divider(height: 1, color: isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[200]), |
|
|
|
|
|
|
|
// 备份与恢复 |
|
|
|
_buildNavigationSetting( |
|
|
|
title: '备份与恢复', |
|
|
|
subtitle: '备份设置和AI互动历史', |
|
|
|
icon: Icons.cloud_upload_outlined, |
|
|
|
iconBgColor: isDarkMode ? Colors.cyan[900]!.withOpacity(0.3) : Colors.cyan[100]!, |
|
|
|
iconColor: isDarkMode ? Colors.cyan[300]! : Colors.cyan[600]!, |
|
|
|
value: '上次备份: 今天', |
|
|
|
valueStyle: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.grey[500], |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
onTap: () { |
|
|
|
// 打开备份设置页面 |
|
|
|
}, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
), |
|
|
|
Divider(height: 1, color: isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[200]), |
|
|
|
|
|
|
|
// 隐私设置 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '隐私设置', |
|
|
|
subtitle: '管理数据收集和权限', |
|
|
|
icon: Icons.shield_outlined, |
|
|
|
iconBgColor: isDarkMode ? Colors.purple[900]!.withOpacity(0.3) : Colors.purple[100]!, |
|
|
|
iconColor: isDarkMode ? Colors.purple[300]! : Colors.purple[600]!, |
|
|
|
titleColor: isDarkMode ? Colors.white : null, |
|
|
|
subtitleColor: isDarkMode ? Colors.white70 : null, |
|
|
|
onTap: () { |
|
|
|
// 打开隐私设置页面 |
|
|
|
}, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
), |
|
|
|
Divider(height: 1, color: isDarkMode ? Colors.white.withOpacity(0.1) : Colors.grey[200]), |
|
|
|
|
|
|
|
// 退出登录 |
|
|
|
_buildSimpleNavigationSetting( |
|
|
|
title: '退出登录', |
|
|
|
icon: Icons.logout, |
|
|
|
iconBgColor: isDarkMode ? Colors.red[900]!.withOpacity(0.3) : Colors.red[50]!, |
|
|
|
iconColor: isDarkMode ? Colors.red[300]! : Colors.red[600]!, |
|
|
|
titleColor: isDarkMode ? Colors.red[300]! : Colors.red[600]!, |
|
|
|
onTap: () { |
|
|
|
// 退出登录确认对话框 |
|
|
|
Get.dialog( |
|
|
|
AlertDialog( |
|
|
|
backgroundColor: isDarkMode ? Colors.grey[900] : Colors.white, |
|
|
|
title: Text( |
|
|
|
'退出登录', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
content: Text( |
|
|
|
'确定要退出当前账号吗?', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
actions: [ |
|
|
|
TextButton( |
|
|
|
onPressed: () => Get.back(), |
|
|
|
child: Text( |
|
|
|
'取消', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
TextButton( |
|
|
|
onPressed: () { |
|
|
|
Get.back(); |
|
|
|
controller.signOut(); |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
'确定', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.red[300] : Colors.red[600], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -278,7 +358,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
} |
|
|
|
|
|
|
|
// 关于应用部分 |
|
|
|
Widget _buildAboutSection() { |
|
|
|
Widget _buildAboutSection(bool isDarkMode) { |
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
@ -289,7 +369,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: Colors.blue[600], |
|
|
|
color: isDarkMode ? Colors.blue[400] : Colors.blue[600], |
|
|
|
letterSpacing: 1, |
|
|
|
), |
|
|
|
), |
|
|
|
@ -297,77 +377,88 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
color: isDarkMode ? Colors.white.withOpacity(0.05) : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withOpacity(0.05), |
|
|
|
color: isDarkMode |
|
|
|
? Colors.black.withOpacity(0.2) |
|
|
|
: Colors.black.withOpacity(0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
child: BackdropFilter( |
|
|
|
filter: isDarkMode ? ImageFilter.blur(sigmaX: 5, sigmaY: 5) : ImageFilter.blur(sigmaX: 0, sigmaY: 0), |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: 40.w, |
|
|
|
height: 40.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: const LinearGradient( |
|
|
|
colors: [Color(0xFF2196F3), Color(0xFF9C27B0)], |
|
|
|
begin: Alignment.topLeft, |
|
|
|
end: Alignment.bottomRight, |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
), |
|
|
|
child: Icon( |
|
|
|
Icons.headphones, |
|
|
|
size: 24.w, |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'DeepVoice', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: Colors.black87, |
|
|
|
Container( |
|
|
|
width: 40.w, |
|
|
|
height: 40.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
colors: [ |
|
|
|
const Color(0xFF2196F3).withOpacity(isDarkMode ? 0.7 : 1.0), |
|
|
|
const Color(0xFF9C27B0).withOpacity(isDarkMode ? 0.7 : 1.0) |
|
|
|
], |
|
|
|
begin: Alignment.topLeft, |
|
|
|
end: Alignment.bottomRight, |
|
|
|
), |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 2.h), |
|
|
|
Text( |
|
|
|
'版本 2.4.1 (Build 87)', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
child: Icon( |
|
|
|
Icons.headphones, |
|
|
|
size: 24.w, |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'DeepVoice', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 2.h), |
|
|
|
Text( |
|
|
|
'版本 2.4.1 (Build 87)', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.h), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.blue[100], |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
'检查更新', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.blue[600], |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.h), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? Colors.blue[900]!.withOpacity(0.3) : Colors.blue[100], |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
'检查更新', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.blue[300] : Colors.blue[600], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
@ -378,7 +469,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
'© 2023 DeepVoice Technologies', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.grey[500], |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
@ -386,7 +477,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
'连接世界,超越声音', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.grey[500], |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[500], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -405,6 +496,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
required Color iconColor, |
|
|
|
required bool value, |
|
|
|
required Function(bool) onChanged, |
|
|
|
required bool isDarkMode, |
|
|
|
}) { |
|
|
|
return Padding( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
@ -435,7 +527,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
if (subtitle != null) |
|
|
|
@ -445,7 +537,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
subtitle, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -472,6 +564,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
required String value, |
|
|
|
TextStyle? valueStyle, |
|
|
|
required VoidCallback onTap, |
|
|
|
required bool isDarkMode, |
|
|
|
}) { |
|
|
|
return InkWell( |
|
|
|
onTap: onTap, |
|
|
|
@ -504,7 +597,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
if (subtitle != null) |
|
|
|
@ -514,7 +607,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
subtitle, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -527,7 +620,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
value, |
|
|
|
style: valueStyle ?? TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 8.w), |
|
|
|
@ -535,13 +628,13 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
width: 32.w, |
|
|
|
height: 32.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[100], |
|
|
|
color: isDarkMode ? Colors.white.withOpacity(0.05) : Colors.grey[100], |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
), |
|
|
|
child: Icon( |
|
|
|
Icons.chevron_right, |
|
|
|
size: 16.w, |
|
|
|
color: Colors.grey[500], |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.grey[500], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -560,7 +653,9 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
required Color iconBgColor, |
|
|
|
required Color iconColor, |
|
|
|
Color? titleColor, |
|
|
|
Color? subtitleColor, |
|
|
|
required VoidCallback onTap, |
|
|
|
required bool isDarkMode, |
|
|
|
}) { |
|
|
|
return InkWell( |
|
|
|
onTap: onTap, |
|
|
|
@ -593,7 +688,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
color: titleColor ?? Colors.black87, |
|
|
|
color: titleColor ?? (isDarkMode ? Colors.white : Colors.black87), |
|
|
|
), |
|
|
|
), |
|
|
|
if (subtitle != null) |
|
|
|
@ -603,7 +698,7 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
subtitle, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.black54, |
|
|
|
color: subtitleColor ?? (isDarkMode ? Colors.white70 : Colors.black54), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -614,13 +709,13 @@ class SettingsView extends GetView<SettingsController> { |
|
|
|
width: 32.w, |
|
|
|
height: 32.w, |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[100], |
|
|
|
color: isDarkMode ? Colors.white.withOpacity(0.05) : Colors.grey[100], |
|
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
|
), |
|
|
|
child: Icon( |
|
|
|
Icons.chevron_right, |
|
|
|
size: 16.w, |
|
|
|
color: Colors.grey[500], |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.grey[500], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
|