Browse Source

fix(translation): 修复悬浮窗按钮在Android平台上的显示条件

重构悬浮窗按钮的显示逻辑,将平台检查移到外部条件判断,避免不必要的Obx嵌套
weicu
lxm 12 months ago
parent
commit
235e802466
  1. 6
      lib/modules/translation/views/translation_view.dart
  2. 2
      pubspec.yaml

6
lib/modules/translation/views/translation_view.dart

@ -207,10 +207,10 @@ class TranslationView extends GetView<TranslationController> {
return Row(
children: [
// 悬浮窗切换按钮(仅在支持的模式下显示)
if (Platform.isAndroid)
Obx(() {
if (Platform.isAndroid &&
(controller.currentMode.value == 'call' ||
controller.currentMode.value == 'audioVideo')) {
if (controller.currentMode.value == 'call' ||
controller.currentMode.value == 'audioVideo') {
return IconButton(
icon: Icon(
controller.isFloatingWindowEnabled.value

2
pubspec.yaml

@ -1,7 +1,7 @@
name: voitrans
description: "Voitrans - AI Voice Assistant."
publish_to: "none"
version: 1.0.17+46
version: 1.0.18+53
environment:
sdk: ">=3.3.0 <4.0.0"

Loading…
Cancel
Save