|
|
|
@ -523,63 +523,63 @@ class TranslationView extends GetView<TranslationController> { |
|
|
|
), |
|
|
|
|
|
|
|
// 添加间距 |
|
|
|
SizedBox(height: 16.h), |
|
|
|
//SizedBox(height: 16.h), |
|
|
|
|
|
|
|
// 语音识别结果显示框 |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
padding: EdgeInsets.all(12.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? Colors.grey[800] : Colors.grey[100], |
|
|
|
borderRadius: BorderRadius.circular(8.r), |
|
|
|
border: Border.all( |
|
|
|
color: isDarkMode ? Colors.grey[600]! : Colors.grey[300]!, |
|
|
|
width: 1, |
|
|
|
), |
|
|
|
), |
|
|
|
child: Obx(() { |
|
|
|
// 显示最新的语音识别结果 |
|
|
|
final recognitionText = controller.latestRecognitionText.value; |
|
|
|
final detectedLanguage = controller.detectedLanguageCode1.value; |
|
|
|
// Container( |
|
|
|
// width: double.infinity, |
|
|
|
// padding: EdgeInsets.all(12.w), |
|
|
|
// decoration: BoxDecoration( |
|
|
|
// color: isDarkMode ? Colors.grey[800] : Colors.grey[100], |
|
|
|
// borderRadius: BorderRadius.circular(8.r), |
|
|
|
// border: Border.all( |
|
|
|
// color: isDarkMode ? Colors.grey[600]! : Colors.grey[300]!, |
|
|
|
// width: 1, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// child: Obx(() { |
|
|
|
// // 显示最新的语音识别结果 |
|
|
|
// final recognitionText = controller.latestRecognitionText.value; |
|
|
|
// final detectedLanguage = controller.detectedLanguageCode1.value; |
|
|
|
|
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
// 标题 |
|
|
|
Text( |
|
|
|
'麦头语音识别结果', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
// 识别文本 - 这里显示 finalResult1 的内容 |
|
|
|
Text( |
|
|
|
recognitionText.isEmpty ? '等待语音输入...' : recognitionText, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
height: 1.3, |
|
|
|
), |
|
|
|
), |
|
|
|
// 检测到的语言(如果有) |
|
|
|
if (detectedLanguage.isNotEmpty) ...[ |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Text( |
|
|
|
'检测语言: $detectedLanguage', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: |
|
|
|
isDarkMode ? Colors.grey[500] : Colors.grey[500], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
); |
|
|
|
}), |
|
|
|
), |
|
|
|
// return Column( |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
// children: [ |
|
|
|
// // 标题 |
|
|
|
// Text( |
|
|
|
// '麦头语音识别结果', |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 12.sp, |
|
|
|
// color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
// fontWeight: FontWeight.w500, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// SizedBox(height: 4.h), |
|
|
|
// // 识别文本 - 这里显示 finalResult1 的内容 |
|
|
|
// Text( |
|
|
|
// recognitionText.isEmpty ? '等待语音输入...' : recognitionText, |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 14.sp, |
|
|
|
// color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
// height: 1.3, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// // 检测到的语言(如果有) |
|
|
|
// if (detectedLanguage.isNotEmpty) ...[ |
|
|
|
// SizedBox(height: 4.h), |
|
|
|
// Text( |
|
|
|
// '检测语言: $detectedLanguage', |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 10.sp, |
|
|
|
// color: |
|
|
|
// isDarkMode ? Colors.grey[500] : Colors.grey[500], |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ], |
|
|
|
// ], |
|
|
|
// ); |
|
|
|
// }), |
|
|
|
// ), |
|
|
|
], |
|
|
|
); |
|
|
|
}), |
|
|
|
|