@ -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 ' ;
@ -21,7 +22,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 ,
@ -29,7 +30,6 @@ class SettingsView extends GetView<SettingsController> {
) ,
) ,
centerTitle: true ,
) ,
body: ListView (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 16. h ) ,
@ -57,10 +57,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,8 +74,10 @@ 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 ) ,
child: BackdropFilter (
filter: isDarkMode
? ImageFilter . blur ( sigmaX: 10 , sigmaY: 10 )
: ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
child: Row (
children: [
Obx ( ( ) = > GestureDetector (
@ -127,8 +126,9 @@ class SettingsView extends GetView<SettingsController> {
SizedBox ( height: 4. h ) ,
Row (
children: [
Container ( / / 会 员 等 级
padding: EdgeInsets . symmetric ( horizontal: 8. w , vertical: 2. h ) ,
Container (
padding: EdgeInsets . symmetric (
horizontal: 8. w , vertical: 2. h ) ,
decoration: BoxDecoration (
color: Colors . blue [ 600 ] ,
borderRadius: BorderRadius . circular ( 10. r ) ,
@ -144,10 +144,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 ,
) ,
@ -206,7 +207,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 ,
@ -232,52 +233,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 ] ,
@ -287,20 +306,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: ( ) {
@ -308,39 +338,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 ,
) ,
) ,
) ,
@ -350,9 +391,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 ] ,
) ,
) ,
) ,
@ -379,7 +422,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 ,
@ -406,7 +449,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: [
@ -418,8 +463,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 ,
@ -446,10 +493,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 ,
) ,
) ,
] ,
@ -457,13 +505,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 ] ,
@ -488,7 +539,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 ] ,
@ -547,8 +598,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 ,
@ -623,14 +673,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 ,
) ,
@ -646,10 +696,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 ,
) ,
) ,
@ -658,7 +709,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 (
@ -720,18 +773,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 ,
) ,
@ -745,7 +801,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 (
@ -778,7 +836,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 (
@ -793,7 +853,7 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
' 语音服务 ' ,
' voiceService ' . tr , / / 语 音 服 务
style: TextStyle (
fontSize: 16. sp ,
fontWeight: FontWeight . w500 ,
@ -802,7 +862,7 @@ class SettingsView extends GetView<SettingsController> {
) ,
SizedBox ( height: 2. h ) ,
Text (
' 选择语音识别和合成服务 ' ,
' voiceServiceInfo ' . tr , / / 选 择 语 音 识 别 和 合 成 服 务
style: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
@ -821,11 +881,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 ] ,
@ -839,7 +900,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 (
@ -871,7 +934,7 @@ class SettingsView extends GetView<SettingsController> {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
' 选择语音服务 ' ,
' selectVoiceService ' . tr , / / 选 择 语 音 服 务
style: TextStyle (
fontSize: 18. sp ,
fontWeight: FontWeight . w600 ,
@ -881,7 +944,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: ( ) {
@ -893,12 +957,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 ,
) ,
@ -910,8 +980,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
@ -928,20 +1002,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 ,
@ -962,7 +1040,7 @@ class SettingsView extends GetView<SettingsController> {
TextButton (
onPressed: ( ) = > Get . back ( ) ,
child: Text (
' 取消 ' ,
' cancel ' . tr , / / 取 消
style: TextStyle (
color: isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
@ -976,4 +1054,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 ,
) ,
) ,
) ,
) ,
) ,
] ,
) ,
) ,
) ,
) ;
}
}