@ -653,12 +653,17 @@ class SettingsView extends GetView<SettingsController> {
) ,
InkWell (
onTap: ( ) {
print ( controller . appVersion . value ) ;
/ / 在 这 里 添 加 检 查 更 新 的 逻 辑
} ,
child: Container (
padding:
EdgeInsets . symmetric ( horizontal: 12. w , vertical: 6. h ) ,
constraints: BoxConstraints (
minWidth: 100. w ,
maxWidth: 180. w ,
) ,
padding: EdgeInsets . symmetric (
horizontal: 16. w ,
vertical: 8. h ,
) ,
decoration: BoxDecoration (
color: isDarkMode
? Colors . blue [ 900 ] ! . withOpacity ( 0.3 )
@ -666,12 +671,14 @@ class SettingsView extends GetView<SettingsController> {
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
child: Text (
' checkUpdates ' . tr , / / 检 查 更 新
' checkUpdates ' . tr ,
style: TextStyle (
fontSize: 12. sp ,
color:
isDarkMode ? Colors . blue [ 300 ] : Colors . blue [ 600 ] ,
color: isDarkMode ? Colors . blue [ 300 ] : Colors . blue [ 600 ] ,
) ,
overflow: TextOverflow . ellipsis , / / 添 加 省 略 号
maxLines: 1 , / / 限 制 为 单 行
textAlign: TextAlign . center , / / 保 持 居 中
) ,
) ,
) ,
@ -1099,7 +1106,7 @@ class SettingsView extends GetView<SettingsController> {
return Obx ( ( ) {
final isSelected =
controller . speechServiceType . value = = service [ ' type ' ] ;
return InkWell (
return GestureDetector (
onTap: ( ) {
controller . setSpeechServiceType ( service [ ' type ' ] ) ;
Get . back ( ) ;
@ -1127,28 +1134,6 @@ class SettingsView extends GetView<SettingsController> {
) ,
child: Row (
children: [
Container (
width: 24. w ,
height: 24. w ,
decoration: BoxDecoration (
color: isSelected
? ( isDarkMode
? Colors . teal [ 300 ]
: Colors . teal [ 600 ] )
: ( isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 300 ] ) ,
shape: BoxShape . circle ,
) ,
child: isSelected
? Icon (
Icons . check ,
size: 16. w ,
color: Colors . white ,
)
: null ,
) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
@ -1179,6 +1164,28 @@ class SettingsView extends GetView<SettingsController> {
] ,
) ,
) ,
SizedBox ( width: 12. w ) ,
Container (
width: 24. w ,
height: 24. w ,
decoration: BoxDecoration (
color: isSelected
? ( isDarkMode
? Colors . teal [ 300 ]
: Colors . teal [ 600 ] )
: ( isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 300 ] ) ,
shape: BoxShape . circle ,
) ,
child: isSelected
? Icon (
Icons . check ,
size: 16. w ,
color: Colors . white ,
)
: null ,
) ,
] ,
) ,
) ,
@ -1211,27 +1218,22 @@ class SettingsView extends GetView<SettingsController> {
void _showLanguageSelectionDialog ( bool isDarkMode ) {
Get . dialog (
Dialog (
backgroundColor: isDarkMode ? Colors . grey [ 900 ] : Colors . white ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 24 .r ) ,
borderRadius: BorderRadius . circular ( 16 .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: Padding (
padding: EdgeInsets . all ( 12. w ) ,
child: Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Padding (
padding: EdgeInsets . symmetric ( horizontal: 24. w ) ,
child: Text (
Text (
' selectLanguage ' . tr , / / 选 择 语 言
style: TextStyle (
fontSize: 20. sp ,
fontWeight: FontWeight . bold ,
color: isDarkMode ? Colors . white : Colors . black ,
) ,
fontSize: 18. sp ,
fontWeight: FontWeight . w600 ,
color: isDarkMode ? Colors . white : Colors . black87 ,
) ,
) ,
SizedBox ( height: 16. h ) ,
@ -1241,46 +1243,104 @@ class SettingsView extends GetView<SettingsController> {
child: Column (
mainAxisSize: MainAxisSize . min ,
children: controller . languageList . map ( ( language ) {
return ListTile (
title: Text (
return Obx ( ( ) {
final isSelected =
controller . language . value . value = = language . value ;
return GestureDetector (
onTap: ( ) {
controller . setLanguage ( language ) ;
Get . back ( ) ;
} ,
child: Container (
margin: EdgeInsets . only ( bottom: 10. h ) ,
padding: EdgeInsets . all ( 10. w ) ,
decoration: BoxDecoration (
color: isSelected
? ( 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 ] ! )
: Colors . transparent ,
width: 1 ,
) ,
) ,
child: Row (
children: [
Expanded (
child: Text (
language . name . tr ,
style: TextStyle (
color: isDarkMode ? Colors . white : Colors . black ,
fontSize: 16. sp ,
fontWeight: FontWeight . w500 ,
color: isDarkMode
? Colors . white
: Colors . black87 ,
) ,
overflow: TextOverflow . ellipsis ,
) ,
) ,
trailing:
controller . language . value . value = = language . value
? Icon (
Icons . check_circle ,
Text (
language . alias , / / 这 里 使 用 原 始 名 称 , 不 加 . tr
style: TextStyle (
fontSize: 14. sp ,
color: isDarkMode
? AppColors . primary
: Colors . blue ,
? Colors . white70
: Colors . black54 ,
) ,
) ,
SizedBox ( width: 10. w ) ,
Container (
width: 24. w ,
height: 24. w ,
decoration: BoxDecoration (
color: isSelected
? ( isDarkMode
? Colors . teal [ 300 ]
: Colors . teal [ 600 ] )
: ( isDarkMode
? Colors . white . withOpacity ( 0.1 )
: Colors . grey [ 300 ] ) ,
shape: BoxShape . circle ,
) ,
child: isSelected
? Icon (
Icons . check ,
size: 16. w ,
color: Colors . white ,
)
: const SizedBox . shrink ( ) ,
onTap: ( ) {
controller . setLanguage ( language ) ;
} ,
: null ,
) ,
] ,
) ,
) ,
) ;
} ) ;
} ) . toList ( ) ,
) ,
) ,
) ,
SizedBox ( height: 16. h ) ,
Align (
alignment: Alignment . centerRight ,
child: Padding (
padding: EdgeInsets . only ( right: 24. w ) ,
child: TextButton (
Row (
mainAxisAlignment: MainAxisAlignment . end ,
children: [
TextButton (
onPressed: ( ) = > Get . back ( ) ,
child: Text (
' cancel ' . tr , / / 取 消
style: TextStyle (
color: isDarkMode ? AppColors . primary : Colors . blue ,
fontSize: 16. sp ,
) ,
color: isDarkMode ? Colors . white70 : Colors . black54 ,
) ,
) ,
) ,
] ,
) ,
] ,
) ,