完善遥控权限、控制发送和急停反馈

This commit is contained in:
2026-11-21 14:37:46 +08:00
parent c284aefc7d
commit 9a8a42a0a1
55 changed files with 5009 additions and 1308 deletions

View File

@@ -615,6 +615,20 @@ class _DeviceDetailPageV2State extends State<DeviceDetailPageV2> {
modeText,
l10n.translate('device_detail_v2.stat_control_mode'),
),
_statCard(
Icons.emergency_outlined,
st?.emergencyStop == null
? '--'
: l10n.translate(
st!.emergencyStop!
? 'device_detail_v2.emergency_stop_active'
: 'device_detail_v2.emergency_stop_inactive',
),
l10n.translate('device_detail_v2.stat_emergency_stop'),
valueColor: st?.emergencyStop == true
? const Color(0xFFDC2626)
: _navy,
),
_statCard(
Icons.thermostat_outlined,
st == null ? '--' : '${st.chipTemp.toStringAsFixed(1)}°',
@@ -678,25 +692,21 @@ class _DeviceDetailPageV2State extends State<DeviceDetailPageV2> {
behavior: HitTestBehavior.opaque,
child: Column(
children: [
Row(
children: [
Expanded(child: tiles[0]),
const SizedBox(width: 10),
Expanded(child: tiles[1]),
const SizedBox(width: 10),
Expanded(child: tiles[2]),
],
),
const SizedBox(height: 8),
Row(
children: [
Expanded(child: tiles[3]),
const SizedBox(width: 10),
Expanded(child: tiles[4]),
const SizedBox(width: 10),
Expanded(child: tiles[5]),
],
),
for (var row = 0; row < tiles.length; row += 3) ...[
if (row > 0) const SizedBox(height: 8),
Row(
children: [
for (var column = 0; column < 3; column++) ...[
if (column > 0) const SizedBox(width: 10),
Expanded(
child: row + column < tiles.length
? tiles[row + column]
: const SizedBox.shrink(),
),
],
],
),
],
],
),
),
@@ -733,6 +743,7 @@ class _DeviceDetailPageV2State extends State<DeviceDetailPageV2> {
String value,
String label, {
double valueFontSize = 16,
Color? valueColor,
}) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 4),
@@ -752,7 +763,7 @@ class _DeviceDetailPageV2State extends State<DeviceDetailPageV2> {
style: TextStyle(
fontSize: valueFontSize,
fontWeight: FontWeight.w800,
color: _navy,
color: valueColor ?? _navy,
),
),
const SizedBox(height: 2),