From 68ec72534de107d2d451ff1af4832a6b9de5e9fa Mon Sep 17 00:00:00 2001 From: Janez T Date: Wed, 18 Mar 2026 16:58:48 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20Sensor=20tiles=20=E2=80=94=20move=20chan?= =?UTF-8?q?nel=20label=20to=20bottom-right,=20smaller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Channel chip (ch2) was inline with the label, stealing horizontal space and causing label truncation ('Temper...'). Now positioned as a tiny 9px label anchored bottom-right of the tile, giving the full width to the metric label and value. --- .../sensors/sensor_telemetry_card.dart | 70 ++++++++----------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/lib/widgets/sensors/sensor_telemetry_card.dart b/lib/widgets/sensors/sensor_telemetry_card.dart index 0529dcc..1de7334 100644 --- a/lib/widgets/sensors/sensor_telemetry_card.dart +++ b/lib/widgets/sensors/sensor_telemetry_card.dart @@ -2251,14 +2251,31 @@ class SensorMetricTile extends StatelessWidget { border: Border.all(color: data.accent.withValues(alpha: 0.14)), ), child: data.mapLocation == null || !allowMapPreview - ? Row( - crossAxisAlignment: CrossAxisAlignment.start, + ? Stack( children: [ - _MetricIcon(accent: data.accent, icon: data.icon), - const SizedBox(width: 10), - Expanded( - child: _MetricText(data: data, keyPrefix: keyPrefix), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _MetricIcon(accent: data.accent, icon: data.icon), + const SizedBox(width: 10), + Expanded( + child: _MetricText(data: data, keyPrefix: keyPrefix), + ), + ], ), + if (data.channel != null) + Positioned( + right: 0, + bottom: 0, + child: Text( + 'ch${data.channel}', + style: TextStyle( + fontSize: 9, + fontWeight: FontWeight.w700, + color: data.accent.withValues(alpha: 0.5), + ), + ), + ), ], ) : Column( @@ -2395,39 +2412,14 @@ class _MetricText extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Text( - data.label, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: data.accent, - fontWeight: FontWeight.w700, - ), - ), - ), - if (data.channel != null) ...[ - const SizedBox(width: 8), - Container( - key: ValueKey('${keyPrefix}_channel_${data.fieldKey}'), - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), - decoration: BoxDecoration( - color: data.accent.withValues(alpha: 0.12), - borderRadius: BorderRadius.circular(999), - ), - child: Text( - 'ch${data.channel}', - style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: data.accent, - fontWeight: FontWeight.w800, - ), - ), - ), - ], - ], + Text( + data.label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.labelMedium?.copyWith( + color: data.accent, + fontWeight: FontWeight.w700, + ), ), const SizedBox(height: 4), Text(