修改UI
This commit is contained in:
2
lib/core/env/env_config.dart
vendored
2
lib/core/env/env_config.dart
vendored
@@ -1,7 +1,7 @@
|
||||
class EnvConfig {
|
||||
static const String environment = String.fromEnvironment(
|
||||
'ENV',
|
||||
defaultValue: 'test',
|
||||
defaultValue: 'prod',
|
||||
);
|
||||
|
||||
static String get sentryDsn {
|
||||
|
||||
@@ -539,13 +539,7 @@ class _BleDeviceDetailPageState extends State<BleDeviceDetailPage> {
|
||||
_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<BleDeviceDetailPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
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<BleDeviceDetailPage> {
|
||||
}
|
||||
|
||||
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<BleDeviceDetailPage> {
|
||||
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<BleDeviceDetailPage> {
|
||||
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}, '
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <agora_rtc_engine/agora_rtc_engine_plugin.h>
|
||||
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
||||
#include <file_selector_windows/file_selector_windows.h>
|
||||
#include <flutter_blue_plus_winrt/flutter_blue_plus_plugin.h>
|
||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||
@@ -21,8 +20,6 @@
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
AgoraRtcEnginePluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
|
||||
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
||||
FileSelectorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||
FlutterBluePlusPluginRegisterWithRegistrar(
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
agora_rtc_engine
|
||||
connectivity_plus
|
||||
file_selector_windows
|
||||
flutter_blue_plus_winrt
|
||||
flutter_webrtc
|
||||
|
||||
Reference in New Issue
Block a user