From 893429c548c6c1e00f984045966703434f139758 Mon Sep 17 00:00:00 2001 From: Constantin Leue <77660791+Consti3D@users.noreply.github.com> Date: Fri, 7 Aug 2026 21:43:59 +0200 Subject: [PATCH] Show climb/sink rate under the altitude readout on the fly-mode map Uses an up/down arrow instead of a +/- sign so the direction reads at a glance, with the magnitude alongside it. --- app/lib/ui/screens/fly/fly_screen.dart | 54 +++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/app/lib/ui/screens/fly/fly_screen.dart b/app/lib/ui/screens/fly/fly_screen.dart index 8ed96ce..806ac59 100644 --- a/app/lib/ui/screens/fly/fly_screen.dart +++ b/app/lib/ui/screens/fly/fly_screen.dart @@ -371,7 +371,20 @@ class _FlyScreenState extends ConsumerState { top: 56, bottom: footerBottomInset, left: 14 + safeEdgeInset, - child: Center(child: _liveReadout('Alt', telemetry?.altitudeM, 'm')), + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _liveReadout('Alt', telemetry?.altitudeM, 'm'), + const SizedBox(height: 6), + // Steig-/Sinkrate direkt unter der Hoehenanzeige (Nutzerwunsch) + // - Pfeil statt Vorzeichen (+/-), da ein Pfeil auf einen Blick + // erfassbar ist, waehrend "+"/"-" bei kleiner Schrift leicht + // uebersehen wird. + _verticalSpeedReadout(telemetry?.verticalSpeedMs), + ], + ), + ), ), Positioned( top: 56, @@ -408,6 +421,45 @@ class _FlyScreenState extends ConsumerState { ); } + /// Steig-/Sinkrate unter der Hoehenanzeige (siehe _liveReadout-Aufrufer + /// oben) - zeigt bewusst einen Pfeil statt eines Vorzeichens vor der Zahl + /// (Nutzerwunsch), der Betrag bleibt trotzdem als Wert sichtbar. >= 0 gilt + /// als Steigen, analog zur Vorzeichen-Konvention in + /// drone_status_messages_panel.dart._formatVerticalSpeed. + Widget _verticalSpeedReadout(double? valueMs) { + final Widget content; + if (valueMs == null) { + content = const Text( + '—', + style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500), + ); + } else { + content = Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + valueMs < 0 ? Icons.arrow_downward : Icons.arrow_upward, + color: Colors.white, + size: 15, + ), + const SizedBox(width: 4), + Text( + '${valueMs.abs().toStringAsFixed(1)} m/s', + style: const TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500), + ), + ], + ); + } + return Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.black.withValues(alpha: 0.7), + borderRadius: BorderRadius.circular(6), + ), + child: content, + ); + } + Widget _liveReadout(String label, double? value, String unit) { return Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),