diff --git a/lib/core/env/env_config.dart b/lib/core/env/env_config.dart index 3000f9a3..c9bdfd1d 100644 --- a/lib/core/env/env_config.dart +++ b/lib/core/env/env_config.dart @@ -1,7 +1,7 @@ class EnvConfig { static const String environment = String.fromEnvironment( 'ENV', - defaultValue: 'test', + defaultValue: 'prod', ); static String get sentryDsn { diff --git a/lib/features/v2/device_list/presentation/pages/ble_device_detail_page.dart b/lib/features/v2/device_list/presentation/pages/ble_device_detail_page.dart index d544d1e0..5595f876 100644 --- a/lib/features/v2/device_list/presentation/pages/ble_device_detail_page.dart +++ b/lib/features/v2/device_list/presentation/pages/ble_device_detail_page.dart @@ -539,13 +539,7 @@ class _BleDeviceDetailPageState extends State { _buildDeviceInfoCard(name, scanResult), const SizedBox(height: 16), _buildConnectionControl(), - if (_isConnected && _services.isNotEmpty) ...[ - const SizedBox(height: 16), - _buildServicesList(), - ], if (_isConnected) ...[ - const SizedBox(height: 16), - _buildCommandSection(), const SizedBox(height: 16), _buildDeviceConfigCard(), const SizedBox(height: 16), @@ -797,6 +791,27 @@ class _BleDeviceDetailPageState extends State { ), ), ), + const SizedBox(width: 12), + // 读配置 按钮(未连接时灰色禁用) + Expanded( + child: ElevatedButton.icon( + onPressed: _isConnected ? _sendReadConfig : null, + icon: const Icon(Icons.settings, size: 18), + label: const Text('读配置'), + style: ElevatedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 14), + backgroundColor: _isConnected + ? context.appColors.primary + : context.appColors.fillBackground, + foregroundColor: _isConnected + ? Colors.white + : context.appColors.textTertiary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), ], ), ], @@ -989,7 +1004,11 @@ class _BleDeviceDetailPageState extends State { } Widget _buildCommLogSection() { - final pushes = _latestPushByCommand.values.toList(); + final pushes = _latestPushByCommand.values + .where((p) => + p.command != MachineProtocolConstants.cmdRemoteControl && + p.command != MachineProtocolConstants.cmdReadConfig) + .toList(); return Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( @@ -1104,23 +1123,6 @@ class _BleDeviceDetailPageState extends State { children: [ Row( children: [ - Container( - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), - decoration: BoxDecoration( - color: colors.badge, - borderRadius: BorderRadius.circular(4), - ), - child: Text( - '0x${p.command.toRadixString(16).toUpperCase().padLeft(2, '0')}', - style: const TextStyle( - fontSize: 10, - fontFamily: 'monospace', - color: Colors.white, - fontWeight: FontWeight.w600, - ), - ), - ), - const SizedBox(width: 8), Expanded( child: Text( name, @@ -1477,33 +1479,6 @@ class _BleDeviceDetailPageState extends State { return; } - // 权限通过提示 - await showDialog( - context: context, - barrierDismissible: false, - builder: (dialogCtx) => AlertDialog( - title: Row( - children: [ - Icon( - Icons.check_circle, - color: context.appColors.success, - size: 28, - ), - const SizedBox(width: 8), - const Text('权限通过'), - ], - ), - content: const Text('您有权限操作此设备'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(dialogCtx), - child: const Text('确定'), - ), - ], - ), - ); - if (!mounted) return; - // 0. 连接状态诊断 developer.log( '[WriteConfig] 🏥 连接状态: isConnected=${BleManager.instance.isConnected}, ' diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 71a40e41..3c0d642e 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,7 +7,6 @@ #include "generated_plugin_registrant.h" #include -#include #include #include #include @@ -21,8 +20,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { AgoraRtcEnginePluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin")); - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); FlutterBluePlusPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 09e2268e..639fd277 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST agora_rtc_engine - connectivity_plus file_selector_windows flutter_blue_plus_winrt flutter_webrtc