|
|
@ -49,8 +49,9 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
elevation: 0, |
|
|
elevation: 0, |
|
|
leading: IconButton( |
|
|
leading: IconButton( |
|
|
icon: Icon( |
|
|
icon: Icon( |
|
|
Icons.arrow_back, |
|
|
Icons.arrow_back_ios, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
|
|
size: 20.sp, |
|
|
), |
|
|
), |
|
|
onPressed: () => Get.back(), |
|
|
onPressed: () => Get.back(), |
|
|
), |
|
|
), |
|
|
@ -96,7 +97,8 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
Obx(() => _buildLanguageButton( |
|
|
Obx(() => _buildLanguageButton( |
|
|
label: 'sourceLanguage'.tr, |
|
|
label: 'sourceLanguage'.tr, |
|
|
selectedLanguage: controller.sourceLanguageChineseName.value, |
|
|
selectedLanguage: controller.sourceLanguageChineseName.value, |
|
|
onTap: () => controller.showLanguageSelector(isSourceLanguage: true), |
|
|
onTap: () => |
|
|
|
|
|
controller.showLanguageSelector(isSourceLanguage: true), |
|
|
isDarkMode: isDarkMode, |
|
|
isDarkMode: isDarkMode, |
|
|
)), |
|
|
)), |
|
|
|
|
|
|
|
|
@ -128,7 +130,8 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
Obx(() => _buildLanguageButton( |
|
|
Obx(() => _buildLanguageButton( |
|
|
label: 'targetLanguage'.tr, |
|
|
label: 'targetLanguage'.tr, |
|
|
selectedLanguage: controller.targetLanguageChineseName.value, |
|
|
selectedLanguage: controller.targetLanguageChineseName.value, |
|
|
onTap: () => controller.showLanguageSelector(isSourceLanguage: false), |
|
|
onTap: () => |
|
|
|
|
|
controller.showLanguageSelector(isSourceLanguage: false), |
|
|
isDarkMode: isDarkMode, |
|
|
isDarkMode: isDarkMode, |
|
|
)), |
|
|
)), |
|
|
], |
|
|
], |
|
|
@ -257,7 +260,9 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
return Obx(() => SizedBox( |
|
|
return Obx(() => SizedBox( |
|
|
width: double.infinity, |
|
|
width: double.infinity, |
|
|
child: ElevatedButton( |
|
|
child: ElevatedButton( |
|
|
onPressed: controller.isTranslating.value ? null : controller.translateText, |
|
|
onPressed: controller.isTranslating.value |
|
|
|
|
|
? null |
|
|
|
|
|
: controller.translateText, |
|
|
style: ElevatedButton.styleFrom( |
|
|
style: ElevatedButton.styleFrom( |
|
|
backgroundColor: Colors.blue, |
|
|
backgroundColor: Colors.blue, |
|
|
foregroundColor: Colors.white, |
|
|
foregroundColor: Colors.white, |
|
|
@ -277,7 +282,8 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
height: 20.w, |
|
|
height: 20.w, |
|
|
child: const CircularProgressIndicator( |
|
|
child: const CircularProgressIndicator( |
|
|
strokeWidth: 2, |
|
|
strokeWidth: 2, |
|
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.white), |
|
|
valueColor: |
|
|
|
|
|
AlwaysStoppedAnimation<Color>(Colors.white), |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
SizedBox(width: 12.w), |
|
|
SizedBox(width: 12.w), |
|
|
@ -339,7 +345,8 @@ class TextTranslationView extends GetView<TextTranslationController> { |
|
|
GestureDetector( |
|
|
GestureDetector( |
|
|
onTap: controller.copyResult, |
|
|
onTap: controller.copyResult, |
|
|
child: Container( |
|
|
child: Container( |
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.h), |
|
|
padding: |
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.h), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: Colors.blue.withOpacity(0.1), |
|
|
color: Colors.blue.withOpacity(0.1), |
|
|
borderRadius: BorderRadius.circular(6.r), |
|
|
borderRadius: BorderRadius.circular(6.r), |
|
|
|