修改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 {
|
class EnvConfig {
|
||||||
static const String environment = String.fromEnvironment(
|
static const String environment = String.fromEnvironment(
|
||||||
'ENV',
|
'ENV',
|
||||||
defaultValue: 'test',
|
defaultValue: 'prod',
|
||||||
);
|
);
|
||||||
|
|
||||||
static String get sentryDsn {
|
static String get sentryDsn {
|
||||||
|
|||||||
@@ -539,13 +539,7 @@ class _BleDeviceDetailPageState extends State<BleDeviceDetailPage> {
|
|||||||
_buildDeviceInfoCard(name, scanResult),
|
_buildDeviceInfoCard(name, scanResult),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
_buildConnectionControl(),
|
_buildConnectionControl(),
|
||||||
if (_isConnected && _services.isNotEmpty) ...[
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
_buildServicesList(),
|
|
||||||
],
|
|
||||||
if (_isConnected) ...[
|
if (_isConnected) ...[
|
||||||
const SizedBox(height: 16),
|
|
||||||
_buildCommandSection(),
|
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
_buildDeviceConfigCard(),
|
_buildDeviceConfigCard(),
|
||||||
const SizedBox(height: 16),
|
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() {
|
Widget _buildCommLogSection() {
|
||||||
final pushes = _latestPushByCommand.values.toList();
|
final pushes = _latestPushByCommand.values
|
||||||
|
.where((p) =>
|
||||||
|
p.command != MachineProtocolConstants.cmdRemoteControl &&
|
||||||
|
p.command != MachineProtocolConstants.cmdReadConfig)
|
||||||
|
.toList();
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -1104,23 +1123,6 @@ class _BleDeviceDetailPageState extends State<BleDeviceDetailPage> {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
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(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
name,
|
name,
|
||||||
@@ -1477,33 +1479,6 @@ class _BleDeviceDetailPageState extends State<BleDeviceDetailPage> {
|
|||||||
return;
|
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. 连接状态诊断
|
// 0. 连接状态诊断
|
||||||
developer.log(
|
developer.log(
|
||||||
'[WriteConfig] 🏥 连接状态: isConnected=${BleManager.instance.isConnected}, '
|
'[WriteConfig] 🏥 连接状态: isConnected=${BleManager.instance.isConnected}, '
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
#include <agora_rtc_engine/agora_rtc_engine_plugin.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 <file_selector_windows/file_selector_windows.h>
|
||||||
#include <flutter_blue_plus_winrt/flutter_blue_plus_plugin.h>
|
#include <flutter_blue_plus_winrt/flutter_blue_plus_plugin.h>
|
||||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||||
@@ -21,8 +20,6 @@
|
|||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
AgoraRtcEnginePluginRegisterWithRegistrar(
|
AgoraRtcEnginePluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
|
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
|
||||||
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
|
|
||||||
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
|
||||||
FileSelectorWindowsRegisterWithRegistrar(
|
FileSelectorWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||||
FlutterBluePlusPluginRegisterWithRegistrar(
|
FlutterBluePlusPluginRegisterWithRegistrar(
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
agora_rtc_engine
|
agora_rtc_engine
|
||||||
connectivity_plus
|
|
||||||
file_selector_windows
|
file_selector_windows
|
||||||
flutter_blue_plus_winrt
|
flutter_blue_plus_winrt
|
||||||
flutter_webrtc
|
flutter_webrtc
|
||||||
|
|||||||
Reference in New Issue
Block a user