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:
@@ -136,3 +136,16 @@ LatLng? computeRubberBandTarget({
|
||||
final target = waypoints[activeWaypointIndex];
|
||||
return LatLng(target.lat, target.lon);
|
||||
}
|
||||
|
||||
/// Entfernung von der aktuellen Position zum Homepoint in Metern (Doku:
|
||||
/// "Entfernung zum Home Punkt als letztes Element in der Details-Pille im
|
||||
/// Fly-Modus anzeigen") - null, solange eine der beiden Positionen nicht
|
||||
/// bekannt ist (kein GPS-Fix bzw. Homepoint noch nicht abgefragt, siehe
|
||||
/// home_point_provider.dart).
|
||||
double? computeDistanceToHomeM({
|
||||
required LatLng? currentPosition,
|
||||
required LatLng? homePoint,
|
||||
}) {
|
||||
if (currentPosition == null || homePoint == null) return null;
|
||||
return _distance(currentPosition, homePoint);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user