|
|
@ -208,8 +208,9 @@ class TranslationView extends GetView<TranslationController> { |
|
|
children: [ |
|
|
children: [ |
|
|
// 悬浮窗切换按钮(仅在支持的模式下显示) |
|
|
// 悬浮窗切换按钮(仅在支持的模式下显示) |
|
|
Obx(() { |
|
|
Obx(() { |
|
|
if (controller.currentMode.value == 'call' || |
|
|
if (Platform.isAndroid && |
|
|
controller.currentMode.value == 'audioVideo') { |
|
|
(controller.currentMode.value == 'call' || |
|
|
|
|
|
controller.currentMode.value == 'audioVideo')) { |
|
|
return IconButton( |
|
|
return IconButton( |
|
|
icon: Icon( |
|
|
icon: Icon( |
|
|
controller.isFloatingWindowEnabled.value |
|
|
controller.isFloatingWindowEnabled.value |
|
|
@ -269,19 +270,26 @@ class TranslationView extends GetView<TranslationController> { |
|
|
}), |
|
|
}), |
|
|
], |
|
|
], |
|
|
bottom: PreferredSize( |
|
|
bottom: PreferredSize( |
|
|
preferredSize: Size.fromHeight(50.h), |
|
|
preferredSize: Size.fromHeight( |
|
|
|
|
|
controller.currentMode.value == 'call' ? 70.h : 50.h, |
|
|
|
|
|
), |
|
|
child: Padding( |
|
|
child: Padding( |
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), |
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), |
|
|
child: Row( |
|
|
child: Column( |
|
|
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
|
|
children: [ |
|
|
|
|
|
// 原语言选择行 |
|
|
|
|
|
Row( |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
children: [ |
|
|
children: [ |
|
|
// 源语言选择 |
|
|
// 源语言选择 |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: GestureDetector( |
|
|
child: GestureDetector( |
|
|
onTap: () => LanguageSelectionDialog.show(true, isDarkMode), |
|
|
onTap: () => |
|
|
|
|
|
LanguageSelectionDialog.show(true, isDarkMode), |
|
|
child: Container( |
|
|
child: Container( |
|
|
padding: |
|
|
padding: EdgeInsets.symmetric( |
|
|
EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h), |
|
|
horizontal: 8.w, vertical: 4.h), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: isDarkMode |
|
|
color: isDarkMode |
|
|
? Colors.white.withOpacity(0.1) |
|
|
? Colors.white.withOpacity(0.1) |
|
|
@ -290,7 +298,7 @@ class TranslationView extends GetView<TranslationController> { |
|
|
), |
|
|
), |
|
|
child: Obx(() => Text( |
|
|
child: Obx(() => Text( |
|
|
'${controller.sourceLanguage.value.split(' ')[0]}' |
|
|
'${controller.sourceLanguage.value.split(' ')[0]}' |
|
|
.tr, // Just show the Chinese part |
|
|
.tr, |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 16.sp, |
|
|
fontSize: 16.sp, |
|
|
fontWeight: FontWeight.w600, |
|
|
fontWeight: FontWeight.w600, |
|
|
@ -326,10 +334,11 @@ class TranslationView extends GetView<TranslationController> { |
|
|
// 目标语言选择 |
|
|
// 目标语言选择 |
|
|
Expanded( |
|
|
Expanded( |
|
|
child: GestureDetector( |
|
|
child: GestureDetector( |
|
|
onTap: () => LanguageSelectionDialog.show(false, isDarkMode), |
|
|
onTap: () => |
|
|
|
|
|
LanguageSelectionDialog.show(false, isDarkMode), |
|
|
child: Container( |
|
|
child: Container( |
|
|
padding: |
|
|
padding: EdgeInsets.symmetric( |
|
|
EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h), |
|
|
horizontal: 8.w, vertical: 4.h), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: isDarkMode |
|
|
color: isDarkMode |
|
|
? Colors.white.withOpacity(0.1) |
|
|
? Colors.white.withOpacity(0.1) |
|
|
@ -346,8 +355,9 @@ class TranslationView extends GetView<TranslationController> { |
|
|
style: TextStyle( |
|
|
style: TextStyle( |
|
|
fontSize: 16.sp, |
|
|
fontSize: 16.sp, |
|
|
fontWeight: FontWeight.w600, |
|
|
fontWeight: FontWeight.w600, |
|
|
color: |
|
|
color: isDarkMode |
|
|
isDarkMode ? Colors.white : Colors.black, |
|
|
? Colors.white |
|
|
|
|
|
: Colors.black, |
|
|
), |
|
|
), |
|
|
textAlign: TextAlign.center, |
|
|
textAlign: TextAlign.center, |
|
|
overflow: TextOverflow.ellipsis, |
|
|
overflow: TextOverflow.ellipsis, |
|
|
@ -371,6 +381,41 @@ class TranslationView extends GetView<TranslationController> { |
|
|
), |
|
|
), |
|
|
], |
|
|
], |
|
|
), |
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
// 通话模式下的“对方 / 我”标签行 |
|
|
|
|
|
if (controller.currentMode.value == 'call') ...[ |
|
|
|
|
|
SizedBox(height: 6.h), |
|
|
|
|
|
Row( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'me'.tr, //我 |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
|
), |
|
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
// 预留与上方互换按钮大致等宽的间距,保证对齐 |
|
|
|
|
|
SizedBox(width: 44.w), |
|
|
|
|
|
Expanded( |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'counterPart'.tr, //对方 |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
|
), |
|
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
); |
|
|
); |
|
|
|