@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import ' package:get/get.dart ' ;
import ' package:flutter_screenutil/flutter_screenutil.dart ' ;
import ' dart:ui ' ;
import ' ../../../core/theme/app_colors.dart ' ;
import ' ../controllers/settings_controller.dart ' ;
import ' ../../../core/widgets/common_bottom_nav.dart ' ;
import ' ../../../routes/app_routes.dart ' ;
@ -20,7 +21,7 @@ class SettingsView extends GetView<SettingsController> {
backgroundColor: isDarkMode ? Colors . black : Colors . white ,
elevation: 0.5 ,
title: Text (
' 设置 ' ,
' settings ' . tr , / / 设 置
style: TextStyle (
fontSize: 17. sp ,
fontWeight: FontWeight . w600 ,
@ -28,7 +29,6 @@ class SettingsView extends GetView<SettingsController> {
) ,
) ,
centerTitle: true ,
) ,
body: ListView (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 16. h ) ,
@ -56,10 +56,7 @@ class SettingsView extends GetView<SettingsController> {
const Color ( 0xFF1A1A1A ) . withOpacity ( 0.7 ) ,
const Color ( 0xFF2A2A2A ) . withOpacity ( 0.7 )
]
: [
const Color ( 0xFFE3F2FD ) ,
const Color ( 0xFFF3E5F5 )
] ,
: [ const Color ( 0xFFE3F2FD ) , const Color ( 0xFFF3E5F5 ) ] ,
begin: Alignment . topLeft ,
end: Alignment . bottomRight ,
) ,
@ -77,7 +74,9 @@ class SettingsView extends GetView<SettingsController> {
child: ClipRRect (
borderRadius: BorderRadius . circular ( 16. r ) ,
child: BackdropFilter (
filter: isDarkMode ? ImageFilter . blur ( sigmaX: 10 , sigmaY: 10 ) : ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
filter: isDarkMode
? ImageFilter . blur ( sigmaX: 10 , sigmaY: 10 )
: ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
child: Row (
children: [
Container (
@ -119,13 +118,14 @@ class SettingsView extends GetView<SettingsController> {
Row (
children: [
Container (
padding: EdgeInsets . symmetric ( horizontal: 8. w , vertical: 2. h ) ,
padding: EdgeInsets . symmetric (
horizontal: 8. w , vertical: 2. h ) ,
decoration: BoxDecoration (
color: Colors . blue [ 600 ] ,
borderRadius: BorderRadius . circular ( 10. r ) ,
) ,
child: Text (
' 高级会员 ' ,
' premiumMember ' . tr , / / 高 级 会 员
style: TextStyle (
fontSize: 10. sp ,
color: Colors . white ,
@ -135,10 +135,11 @@ class SettingsView extends GetView<SettingsController> {
SizedBox ( width: 8. w ) ,
Flexible (
child: Text (
' 已连接设备: DeepVoice Pro' ,
' ${ ' joinDevice ' . tr } DeepVoice Pro' , / / 已 连 接 设 备 :
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color:
isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
@ -147,7 +148,7 @@ class SettingsView extends GetView<SettingsController> {
) ,
SizedBox ( height: 4. h ) ,
Text (
' 账号ID: deepvoice_834291' ,
' ${ ' accountId ' . tr } deepvoice_834291' , / / 账 号 ID:
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
@ -193,7 +194,7 @@ class SettingsView extends GetView<SettingsController> {
Padding (
padding: EdgeInsets . only ( left: 4. w , bottom: 8. h ) ,
child: Text (
' 系统设置 ' ,
' systemSetting ' . tr , / / 系 统 设 置
style: TextStyle (
fontSize: 12. sp ,
fontWeight: FontWeight . w500 ,
@ -219,52 +220,70 @@ class SettingsView extends GetView<SettingsController> {
child: ClipRRect (
borderRadius: BorderRadius . circular ( 16. r ) ,
child: BackdropFilter (
filter: isDarkMode ? ImageFilter . blur ( sigmaX: 5 , sigmaY: 5 ) : ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
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 ,
/ / 语 言 设 置
Obx (
( ) = > _buildSimpleNavigationSetting (
title: ' languageSetting ' . tr , / / 语 言 设 置
subtitle: controller . language . value . name . tr ,
icon: Icons . language ,
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: ( ) {
_showLanguageSelectionDialog ( isDarkMode ) ;
} ,
isDarkMode: isDarkMode ,
) ,
) ,
Divider ( height: 1 , color: isDarkMode ? Colors . white . withOpacity ( 0.1 ) : Colors . grey [ 200 ] ) ,
Divider (
height: 1 ,
color: isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 200 ] ) ,
/ / 主 题 设 置
_buildToggleSetting (
title: ' 暗黑模式 ' ,
subtitle: ' 切换应用的明暗主题 ' ,
title: ' darkMode ' . tr , / / 暗 黑 模 式
subtitle: ' darkModeInfo ' . tr , / / 切 换 应 用 的 明 暗 主 题
icon: isDarkMode ? Icons . dark_mode : Icons . light_mode ,
iconBgColor: isDarkMode
? Colors . indigo [ 900 ] ! . withOpacity ( 0.3 )
: Colors . amber [ 100 ] ! ,
iconColor: isDarkMode
? Colors . indigo [ 300 ] !
: Colors . amber [ 600 ] ! ,
iconColor:
isDarkMode ? Colors . indigo [ 300 ] ! : Colors . amber [ 600 ] ! ,
value: isDarkMode ,
onChanged: ( value ) {
controller . toggleTheme ( ) ;
} ,
isDarkMode: isDarkMode ,
) ,
Divider ( height: 1 , color: isDarkMode ? Colors . white . withOpacity ( 0.1 ) : Colors . grey [ 200 ] ) ,
Divider (
height: 1 ,
color: isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 200 ] ) ,
/ / 备 份 与 恢 复
_buildNavigationSetting (
title: ' 备份与恢复 ' ,
subtitle: ' 备份设置和AI互动历史 ' ,
title: ' backups ' . tr , / / 备 份 与 恢 复
subtitle: ' backupsInfo ' . tr , / / 备 份 设 置 和 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: ' 上次备份: 今天 ' ,
iconBgColor: isDarkMode
? Colors . cyan [ 900 ] ! . withOpacity ( 0.3 )
: Colors . cyan [ 100 ] ! ,
iconColor:
isDarkMode ? Colors . cyan [ 300 ] ! : Colors . cyan [ 600 ] ! ,
value: ' ${ ' lastBackup ' . tr } 今天 ' , / / 上 次 备 份 :
valueStyle: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . grey [ 500 ] ,
@ -274,20 +293,31 @@ class SettingsView extends GetView<SettingsController> {
} ,
isDarkMode: isDarkMode ,
) ,
Divider ( height: 1 , color: isDarkMode ? Colors . white . withOpacity ( 0.1 ) : Colors . grey [ 200 ] ) ,
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 ] ) ,
Divider (
height: 1 ,
color: isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 200 ] ) ,
/ / 隐 私 设 置
_buildSimpleNavigationSetting (
title: ' 隐私设置 ' ,
subtitle: ' 管理数据收集和权限 ' ,
title: ' privacySettings ' . tr , / / 隐 私 设 置
subtitle: ' privacySettingsInfo ' . tr , / / 管 理 数 据 收 集 和 权 限
icon: Icons . shield_outlined ,
iconBgColor: isDarkMode ? Colors . purple [ 900 ] ! . withOpacity ( 0.3 ) : Colors . purple [ 100 ] ! ,
iconColor: isDarkMode ? Colors . purple [ 300 ] ! : Colors . purple [ 600 ] ! ,
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: ( ) {
@ -295,39 +325,50 @@ class SettingsView extends GetView<SettingsController> {
} ,
isDarkMode: isDarkMode ,
) ,
Divider ( height: 1 , color: isDarkMode ? Colors . white . withOpacity ( 0.1 ) : Colors . grey [ 200 ] ) ,
Divider (
height: 1 ,
color: isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 200 ] ) ,
/ / 退 出 登 录
_buildSimpleNavigationSetting (
title: ' 退出登录 ' ,
title: ' logout ' . tr , / / 退 出 登 录
icon: Icons . logout ,
iconBgColor: isDarkMode ? Colors . red [ 900 ] ! . withOpacity ( 0.3 ) : Colors . red [ 50 ] ! ,
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 ] ! ,
titleColor:
isDarkMode ? Colors . red [ 300 ] ! : Colors . red [ 600 ] ! ,
onTap: ( ) {
/ / 退 出 登 录 确 认 对 话 框
Get . dialog (
AlertDialog (
backgroundColor: isDarkMode ? Colors . grey [ 900 ] : Colors . white ,
backgroundColor:
isDarkMode ? Colors . grey [ 900 ] : Colors . white ,
title: Text (
' 退出登录 ' ,
' logout ' . tr , / / 退 出 登 录
style: TextStyle (
color: isDarkMode ? Colors . white : Colors . black87 ,
) ,
) ,
content: Text (
' 确定要退出当前账号吗? ' ,
' logoutTips ' . tr , / / 确 定 要 退 出 当 前 账 号 吗 ?
style: TextStyle (
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color:
isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
) ,
actions: [
TextButton (
onPressed: ( ) = > Get . back ( ) ,
child: Text (
' 取消 ' ,
' cancel ' . tr , / / 取 消
style: TextStyle (
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color: isDarkMode
? Colors . white70
: Colors . black54 ,
) ,
) ,
) ,
@ -337,9 +378,11 @@ class SettingsView extends GetView<SettingsController> {
controller . signOut ( ) ;
} ,
child: Text (
' 确定 ' ,
' confirm ' . tr , / / 确 定
style: TextStyle (
color: isDarkMode ? Colors . red [ 300 ] : Colors . red [ 600 ] ,
color: isDarkMode
? Colors . red [ 300 ]
: Colors . red [ 600 ] ,
) ,
) ,
) ,
@ -366,7 +409,7 @@ class SettingsView extends GetView<SettingsController> {
Padding (
padding: EdgeInsets . only ( left: 4. w , bottom: 8. h ) ,
child: Text (
' 关于应用 ' ,
' aboutApplication ' . tr , / / 关 于 应 用
style: TextStyle (
fontSize: 12. sp ,
fontWeight: FontWeight . w500 ,
@ -393,7 +436,9 @@ class SettingsView extends GetView<SettingsController> {
child: ClipRRect (
borderRadius: BorderRadius . circular ( 16. r ) ,
child: BackdropFilter (
filter: isDarkMode ? ImageFilter . blur ( sigmaX: 5 , sigmaY: 5 ) : ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
filter: isDarkMode
? ImageFilter . blur ( sigmaX: 5 , sigmaY: 5 )
: ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: [
@ -405,8 +450,10 @@ class SettingsView extends GetView<SettingsController> {
decoration: BoxDecoration (
gradient: LinearGradient (
colors: [
const Color ( 0xFF2196F3 ) . withOpacity ( isDarkMode ? 0.7 : 1.0 ) ,
const Color ( 0xFF9C27B0 ) . withOpacity ( isDarkMode ? 0.7 : 1.0 )
const Color ( 0xFF2196F3 )
. withOpacity ( isDarkMode ? 0.7 : 1.0 ) ,
const Color ( 0xFF9C27B0 )
. withOpacity ( isDarkMode ? 0.7 : 1.0 )
] ,
begin: Alignment . topLeft ,
end: Alignment . bottomRight ,
@ -433,10 +480,11 @@ class SettingsView extends GetView<SettingsController> {
) ,
SizedBox ( height: 2. h ) ,
Text (
' 版本 2.4.1 (Build 87)' ,
' ${ ' versions ' . tr } 2.4.1 (Build 87)' , / / 版 本
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color:
isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
) ,
] ,
@ -444,13 +492,16 @@ class SettingsView extends GetView<SettingsController> {
] ,
) ,
Container (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 6. h ) ,
padding:
EdgeInsets . symmetric ( horizontal: 12. w , vertical: 6. h ) ,
decoration: BoxDecoration (
color: isDarkMode ? Colors . blue [ 900 ] ! . withOpacity ( 0.3 ) : Colors . blue [ 100 ] ,
color: isDarkMode
? Colors . blue [ 900 ] ! . withOpacity ( 0.3 )
: Colors . blue [ 100 ] ,
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Text (
' 检查更新 ' ,
' checkUpdates ' . tr , / / 检 查 更 新
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . blue [ 300 ] : Colors . blue [ 600 ] ,
@ -475,7 +526,7 @@ class SettingsView extends GetView<SettingsController> {
) ,
SizedBox ( height: 4. h ) ,
Text (
' 连接世界,超越声音 ' ,
' homeSlogan ' . tr , / / 连 接 世 界 , 超 越 声 音
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . grey [ 400 ] : Colors . grey [ 500 ] ,
@ -534,8 +585,7 @@ class SettingsView extends GetView<SettingsController> {
) ,
overflow: TextOverflow . ellipsis ,
) ,
if ( subtitle ! = null )
SizedBox ( height: 2. h ) ,
if ( subtitle ! = null ) SizedBox ( height: 2. h ) ,
if ( subtitle ! = null )
Text (
subtitle ,
@ -610,14 +660,14 @@ class SettingsView extends GetView<SettingsController> {
) ,
overflow: TextOverflow . ellipsis ,
) ,
if ( subtitle ! = null )
SizedBox ( height: 2. h ) ,
if ( subtitle ! = null ) SizedBox ( height: 2. h ) ,
if ( subtitle ! = null )
Text (
subtitle ,
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color:
isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
@ -633,10 +683,11 @@ class SettingsView extends GetView<SettingsController> {
Flexible (
child: Text (
value ,
style: valueStyle ? ? TextStyle (
fontSize: 14. sp ,
color: isDarkMode ? Colors . white : Colors . black87 ,
) ,
style: valueStyle ? ?
TextStyle (
fontSize: 14. sp ,
color: isDarkMode ? Colors . white : Colors . black87 ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
) ,
@ -645,7 +696,9 @@ class SettingsView extends GetView<SettingsController> {
width: 32. w ,
height: 32. w ,
decoration: BoxDecoration (
color: isDarkMode ? Colors . white . withOpacity ( 0.05 ) : Colors . grey [ 100 ] ,
color: isDarkMode
? Colors . white . withOpacity ( 0.05 )
: Colors . grey [ 100 ] ,
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Icon (
@ -707,18 +760,21 @@ class SettingsView extends GetView<SettingsController> {
style: TextStyle (
fontSize: 16. sp ,
fontWeight: FontWeight . w500 ,
color: titleColor ? ? ( isDarkMode ? Colors . white : Colors . black87 ) ,
color: titleColor ? ?
( isDarkMode ? Colors . white : Colors . black87 ) ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
if ( subtitle ! = null )
SizedBox ( height: 2. h ) ,
if ( subtitle ! = null ) SizedBox ( height: 2. h ) ,
if ( subtitle ! = null )
Text (
subtitle ,
style: TextStyle (
fontSize: 12. sp ,
color: subtitleColor ? ? ( isDarkMode ? Colors . white70 : Colors . black54 ) ,
color: subtitleColor ? ?
( isDarkMode
? Colors . white70
: Colors . black54 ) ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
@ -732,7 +788,9 @@ class SettingsView extends GetView<SettingsController> {
width: 32. w ,
height: 32. w ,
decoration: BoxDecoration (
color: isDarkMode ? Colors . white . withOpacity ( 0.05 ) : Colors . grey [ 100 ] ,
color: isDarkMode
? Colors . white . withOpacity ( 0.05 )
: Colors . grey [ 100 ] ,
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Icon (
@ -765,7 +823,9 @@ class SettingsView extends GetView<SettingsController> {
width: 32. w ,
height: 32. w ,
decoration: BoxDecoration (
color: isDarkMode ? Colors . teal [ 900 ] ! . withOpacity ( 0.3 ) : Colors . teal [ 100 ] ! ,
color: isDarkMode
? Colors . teal [ 900 ] ! . withOpacity ( 0.3 )
: Colors . teal [ 100 ] ! ,
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Icon (
@ -780,7 +840,7 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
' 语音服务 ' ,
' voiceService ' . tr , / / 语 音 服 务
style: TextStyle (
fontSize: 16. sp ,
fontWeight: FontWeight . w500 ,
@ -789,7 +849,7 @@ class SettingsView extends GetView<SettingsController> {
) ,
SizedBox ( height: 2. h ) ,
Text (
' 选择语音识别和合成服务 ' ,
' voiceServiceInfo ' . tr , / / 选 择 语 音 识 别 和 合 成 服 务
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
@ -808,11 +868,12 @@ class SettingsView extends GetView<SettingsController> {
Obx ( ( ) {
final serviceType = controller . speechServiceType . value ;
final serviceName = controller . availableSpeechServices
. firstWhere ( ( service ) = > service [ ' type ' ] = = serviceType ) [ ' name ' ] ;
. firstWhere (
( service ) = > service [ ' type ' ] = = serviceType ) [ ' name ' ] ;
return Flexible (
child: Text (
serviceName ,
' $ serviceName ' . tr ,
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . grey [ 600 ] ,
@ -826,7 +887,9 @@ class SettingsView extends GetView<SettingsController> {
width: 32. w ,
height: 32. w ,
decoration: BoxDecoration (
color: isDarkMode ? Colors . white . withOpacity ( 0.05 ) : Colors . grey [ 100 ] ,
color: isDarkMode
? Colors . white . withOpacity ( 0.05 )
: Colors . grey [ 100 ] ,
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Icon (
@ -858,7 +921,7 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
' 选择语音服务 ' ,
' selectVoiceService ' . tr , / / 选 择 语 音 服 务
style: TextStyle (
fontSize: 18. sp ,
fontWeight: FontWeight . w600 ,
@ -868,7 +931,8 @@ class SettingsView extends GetView<SettingsController> {
SizedBox ( height: 16. h ) ,
. . . controller . availableSpeechServices . map ( ( service ) {
return Obx ( ( ) {
final isSelected = controller . speechServiceType . value = = service [ ' type ' ] ;
final isSelected =
controller . speechServiceType . value = = service [ ' type ' ] ;
return InkWell (
onTap: ( ) {
@ -880,12 +944,18 @@ class SettingsView extends GetView<SettingsController> {
padding: EdgeInsets . all ( 12. w ) ,
decoration: BoxDecoration (
color: isSelected
? ( isDarkMode ? Colors . teal [ 900 ] ! . withOpacity ( 0.3 ) : Colors . teal [ 50 ] ! )
: ( isDarkMode ? Colors . white . withOpacity ( 0.05 ) : Colors . grey [ 100 ] ! ) ,
? ( isDarkMode
? Colors . teal [ 900 ] ! . withOpacity ( 0.3 )
: Colors . teal [ 50 ] ! )
: ( isDarkMode
? Colors . white . withOpacity ( 0.05 )
: Colors . grey [ 100 ] ! ) ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: isSelected
? ( isDarkMode ? Colors . teal [ 300 ] ! : Colors . teal [ 600 ] ! )
? ( isDarkMode
? Colors . teal [ 300 ] !
: Colors . teal [ 600 ] ! )
: Colors . transparent ,
width: 1 ,
) ,
@ -897,8 +967,12 @@ class SettingsView extends GetView<SettingsController> {
height: 24. w ,
decoration: BoxDecoration (
color: isSelected
? ( isDarkMode ? Colors . teal [ 300 ] : Colors . teal [ 600 ] )
: ( isDarkMode ? Colors . white . withOpacity ( 0.1 ) : Colors . grey [ 300 ] ) ,
? ( isDarkMode
? Colors . teal [ 300 ]
: Colors . teal [ 600 ] )
: ( isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 300 ] ) ,
shape: BoxShape . circle ,
) ,
child: isSelected
@ -915,20 +989,24 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
service [ ' name ' ] ,
' ${ service [ ' name ' ] } ' . tr ,
style: TextStyle (
fontSize: 16. sp ,
fontWeight: FontWeight . w500 ,
color: isDarkMode ? Colors . white : Colors . black87 ,
color: isDarkMode
? Colors . white
: Colors . black87 ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
SizedBox ( height: 4. h ) ,
Text (
service [ ' description ' ] ,
' ${ service [ ' description ' ] } ' . tr ,
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
color: isDarkMode
? Colors . white70
: Colors . black54 ,
) ,
overflow: TextOverflow . ellipsis ,
maxLines: 2 ,
@ -949,7 +1027,7 @@ class SettingsView extends GetView<SettingsController> {
TextButton (
onPressed: ( ) = > Get . back ( ) ,
child: Text (
' 取消 ' ,
' cancel ' . tr , / / 取 消
style: TextStyle (
color: isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
@ -963,4 +1041,86 @@ class SettingsView extends GetView<SettingsController> {
) ,
) ;
}
/ / 显 示 语 言 选 择 对 话 框
void _showLanguageSelectionDialog ( bool isDarkMode ) {
Get . dialog (
Dialog (
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 24. r ) ,
) ,
insetPadding: EdgeInsets . symmetric ( horizontal: 20. w ) ,
backgroundColor: isDarkMode ? AppColors . cardBackground : Colors . white ,
child: Container (
width: 0.9 . sw ,
padding: EdgeInsets . only ( top: 32. h , bottom: 16. h ) ,
child: Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: EdgeInsets . symmetric ( horizontal: 24. w ) ,
child: Text (
' selectLanguage ' . tr , / / 选 择 语 言
style: TextStyle (
fontSize: 20. sp ,
fontWeight: FontWeight . bold ,
color: isDarkMode ? Colors . white : Colors . black ,
) ,
) ,
) ,
SizedBox ( height: 16. h ) ,
Container (
constraints: BoxConstraints ( maxHeight: 0.5 . sh ) ,
child: SingleChildScrollView (
child: Column (
mainAxisSize: MainAxisSize . min ,
children: controller . languageList . map ( ( language ) {
return ListTile (
title: Text (
language . name . tr ,
style: TextStyle (
color: isDarkMode ? Colors . white : Colors . black ,
) ,
) ,
trailing:
controller . language . value . value = = language . value
? Icon (
Icons . check_circle ,
color: isDarkMode
? AppColors . primary
: Colors . blue ,
)
: const SizedBox . shrink ( ) ,
onTap: ( ) {
controller . setLanguage ( language ) ;
} ,
) ;
} ) . toList ( ) ,
) ,
) ,
) ,
SizedBox ( height: 16. h ) ,
Align (
alignment: Alignment . centerRight ,
child: Padding (
padding: EdgeInsets . only ( right: 24. w ) ,
child: TextButton (
onPressed: ( ) = > Get . back ( ) ,
child: Text (
' cancel ' . tr , / / 取 消
style: TextStyle (
color: isDarkMode ? AppColors . primary : Colors . blue ,
fontSize: 16. sp ,
) ,
) ,
) ,
) ,
) ,
] ,
) ,
) ,
) ,
) ;
}
}