feat: Enhance BLE connection strength indicator with RSSI display and adjust spacing

This commit is contained in:
Janez T
2025-10-16 13:53:08 +02:00
parent 38cda87841
commit bf4305bdb3

View File

@@ -574,7 +574,7 @@ class _HomeScreenState extends State<HomeScreen>
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// BLE connection strength indicator // BLE connection strength indicator with RSSI
Icon( Icon(
Icons.bluetooth_connected, Icons.bluetooth_connected,
color: deviceInfo.signalRssi != null color: deviceInfo.signalRssi != null
@@ -582,7 +582,17 @@ class _HomeScreenState extends State<HomeScreen>
: Colors.grey, : Colors.grey,
size: 16, size: 16,
), ),
const SizedBox(width: 8), const SizedBox(width: 4),
if (deviceInfo.signalRssi != null)
Text(
'${deviceInfo.signalRssi}dBm',
style: TextStyle(
fontSize: 12,
color: _getSignalColor(deviceInfo.signalRssi!),
fontWeight: FontWeight.w500,
),
),
const SizedBox(width: 12),
// Battery indicator // Battery indicator
if (deviceInfo.batteryPercent != null) ...[ if (deviceInfo.batteryPercent != null) ...[
Icon( Icon(