Show distance to home as a fourth field in the fly-mode details pill
Adds computeDistanceToHomeM() (mission_stats.dart) alongside the existing rubber-band-target helper, wired through MissionFooterBar -> BottomStatsBar the same way flyMissionStatus already is. Only appears once a home point is known, as the last field after waypoint/distance/ duration. Generalized HomePointIcon to take an optional strokeColor: the map marker keeps its dark-fill-plus-white-outline look, while the details pill uses a plain white fill (strokeColor: null) to match the existing monochrome flag/ruler/clock icons instead of looking like a dropped-in map pin.
This commit is contained in:
@@ -11,6 +11,7 @@ import '../providers/active_drone_profile_provider.dart';
|
||||
import '../providers/altitude_profile_provider.dart';
|
||||
import '../providers/mission_meta_provider.dart';
|
||||
import 'drone_status_messages_panel.dart';
|
||||
import 'home_point_icon.dart';
|
||||
import 'missions_drones_panel.dart';
|
||||
import 'mountain_peak_icon.dart';
|
||||
import 'paper_plane_icon.dart';
|
||||
@@ -54,6 +55,7 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
required this.totalDistanceM,
|
||||
required this.totalDurationSec,
|
||||
this.flyMissionStatus,
|
||||
this.distanceToHomeM,
|
||||
this.droneStatus,
|
||||
required this.onTap,
|
||||
required this.onSettingsTap,
|
||||
@@ -71,6 +73,13 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
/// die statischen Felder in der Details-Pille.
|
||||
final FlyMissionStatus? flyMissionStatus;
|
||||
|
||||
/// Nur im Fly-Modus gesetzt (Doku: "zeige die Entfernung zum Home Punkt
|
||||
/// als letztes element in der details pille im fly modus an") - zeigt
|
||||
/// dort ein zusaetzliches, viertes Feld nach Wegpunkt/Distanz/Zeit. Bleibt
|
||||
/// null (kein zusaetzliches Feld), solange kein Homepoint bekannt ist
|
||||
/// oder [flyMissionStatus] selbst null ist (Plan-Modus).
|
||||
final double? distanceToHomeM;
|
||||
|
||||
/// Nur im Fly-Modus gesetzt (Doku: "im fly modus zeigt die drone pille
|
||||
/// den zustand der drohne") - ersetzt dort den Drohnennamen-Chip durch
|
||||
/// die 3-Icon-Statusanzeige (Verbindung/Position/Zustand).
|
||||
@@ -291,6 +300,26 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
fontSize: _footerFontSize,
|
||||
fontWeight: _footerFontWeight,
|
||||
)),
|
||||
// Entfernung zum Homepoint als viertes, letztes Feld (Doku:
|
||||
// "als letztes element in der details pille im fly modus") -
|
||||
// nur im Fly-Modus und nur, sobald ein Homepoint bekannt ist
|
||||
// (siehe home_point_provider.dart), sonst kein zusaetzliches
|
||||
// Feld statt eines erfundenen "—"-Platzhalters.
|
||||
if (flyStatus != null && distanceToHomeM != null) ...[
|
||||
const SizedBox(width: 14),
|
||||
const HomePointIcon(
|
||||
size: _footerIconSize,
|
||||
color: Colors.white,
|
||||
strokeColor: null,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text('${distanceToHomeM!.round()} m',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: _footerFontSize,
|
||||
fontWeight: _footerFontWeight,
|
||||
)),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user