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),