From 1aa83bde44ddd13f59a00692660dd5e08f1d6751 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Tue, 13 May 2025 22:06:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84ExploreController=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除Home模块中未使用的ExploreController依赖,简化代码结构 - 注释掉HomeView中未使用的设备详情卡片和间距 - 优化OTA升级视图中的进度条样式,增加边框和圆角 - 移除HomeController中未使用的openAIGirlfriend方法 --- lib/modules/home/bindings/home_binding.dart | 3 --- lib/modules/home/controllers/home_controller.dart | 9 --------- lib/modules/home/views/home_view.dart | 6 +++--- lib/modules/ota_upgrade/views/ota_upgrade_view.dart | 12 ++++++++++-- pubspec.yaml | 1 + 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/modules/home/bindings/home_binding.dart b/lib/modules/home/bindings/home_binding.dart index 5f976a98b..71ea2c6e1 100644 --- a/lib/modules/home/bindings/home_binding.dart +++ b/lib/modules/home/bindings/home_binding.dart @@ -1,4 +1,3 @@ -import '../../explore/controllers/explore_controller.dart'; import 'package:get/get.dart'; import '../controllers/home_controller.dart'; @@ -6,7 +5,5 @@ class HomeBinding extends Bindings { @override void dependencies() { Get.lazyPut(() => HomeController()); - Get.lazyPut( - () => ExploreController()); // 注册ExploreController } } diff --git a/lib/modules/home/controllers/home_controller.dart b/lib/modules/home/controllers/home_controller.dart index f389cc7d5..7fd3e6f0a 100644 --- a/lib/modules/home/controllers/home_controller.dart +++ b/lib/modules/home/controllers/home_controller.dart @@ -3,7 +3,6 @@ import 'dart:async'; import '../../../routes/app_routes.dart'; import '../../../core/utils/logger.dart'; import 'package:flutter/material.dart'; -import '../../explore/controllers/explore_controller.dart'; import 'package:classic_bluetooth/classic_bluetooth.dart' show BluetoothDevice; import '../../../data/services/bluetooth_manager.dart'; import '../../../data/services/ble_manager.dart'; @@ -20,9 +19,6 @@ enum ConnectionStatus { class HomeController extends GetxController { static HomeController get to => Get.find(); - // 依赖的控制器 - final ExploreController exploreController = Get.find(); - // 连接状态相关 final _connectionStatus = ConnectionStatus.disconnected.obs; final _connectionErrorMsg = ''.obs; @@ -197,11 +193,6 @@ class HomeController extends GetxController { Get.toNamed(Routes.translation); } - /// 打开AI伴侣功能 - void openAIGirlfriend() { - exploreController.onAIFeatureTap(2); - } - /// 展示AI功能 void exploreAIFeatures() { Get.toNamed(Routes.agent); diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index fc2f31eea..e1083c5d2 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -461,8 +461,8 @@ class HomeView extends GetView { ), SizedBox(height: 12.h), _buildBatteryInfoGrid(isDarkMode), - SizedBox(height: 16.h), - _buildDeviceDetailsCard(isDarkMode), + // SizedBox(height: 16.h), + // _buildDeviceDetailsCard(isDarkMode), ], ); } @@ -875,7 +875,7 @@ class HomeView extends GetView { Color(0xFFFF5252).withOpacity(0.3), ], ), - onTap: controller.openAIGirlfriend, + onTap: () {}, height: 85.h, // 增加高度 isDarkMode: isDarkMode, iconColor: const Color(0xFFE91E63), diff --git a/lib/modules/ota_upgrade/views/ota_upgrade_view.dart b/lib/modules/ota_upgrade/views/ota_upgrade_view.dart index b524ec1c6..4555f63c8 100644 --- a/lib/modules/ota_upgrade/views/ota_upgrade_view.dart +++ b/lib/modules/ota_upgrade/views/ota_upgrade_view.dart @@ -289,8 +289,16 @@ class OtaUpgradeView extends GetView { fontWeight: FontWeight.bold, color: isDarkMode ? Colors.blue[300] : Colors.blue[700])), SizedBox(height: 16), - SizedBox( - width: 240, + //SizedBox( + //width: 240, + Container( + decoration: BoxDecoration( + border: Border.all( + color: isDarkMode ? Colors.blue[400]! : Colors.blue[300]!, + width: 1.5, + ), + borderRadius: BorderRadius.circular(12), + ), child: LinearProgressIndicator( value: controller.downloadProgress.value, backgroundColor: diff --git a/pubspec.yaml b/pubspec.yaml index 427b3b9c1..37e68bb5b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: package_info_plus: ^8.3.0 file_picker: ^8.0.0+1 haptic_feedback: ^0.5.1+1 + tencentcloud_cos_sdk_plugin: ^1.2.3 window_size: git: