Show mission map and footer in Fly mode, add area/drone zoom buttons

Fly mode previously showed just a black placeholder. It now renders the
same MissionMap (route + waypoint markers) and footer (warnings banner,
altitude profile, BottomStatsBar) as the Plan screen, minus the
reticle/wheels since flying observes the route rather than replanning it.
Waypoints can still be edited via the details list for spontaneous
in-flight changes.

Live drone position comes from a new telemetryProvider/
flightControllerLinkProvider pair (autoDispose), the first place
FlightControllerLink/TelemetryFrame get wired into the UI - currently
backed by MockFlightControllerLink until a real MSP transport exists
(Doku 4.19). A drone marker renders on the map once a telemetry frame
arrives.

The Fly-mode header keeps the fit-to-area button but replaces "zoom to
home" with "zoom to drone" (FlyMapControls) - the first waypoint isn't a
meaningful reference point anymore once airborne.

Extracted computeMissionStats and MissionFooterBar out of PlanScreen so
Plan/Fly share the exact same stats/footer logic instead of duplicating
it, and extracted NavIconButton out of MapSearchControls so both Plan's
and Fly's map controls use the same button widget.

Widget tests that now mount FlyScreen switch from the ProviderScope-based
_wrap() helper to a manual ProviderContainer with an explicit
FlightControllerLink.disconnect() call before test end - the mock's
Timer.periodic doesn't get cancelled by container disposal alone, and
flutter_test's pending-timer check runs before addTearDown callbacks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Constantin Leue
2026-07-30 07:45:36 +02:00
co-authored by Claude Sonnet 5
parent d745b76403
commit 310d92f187
13 changed files with 611 additions and 104 deletions
+8 -3
View File
@@ -8,6 +8,7 @@ import '../../app_mode/app_mode_cubit.dart';
import '../dmc_colors.dart';
import '../providers/flight_mode_provider.dart';
import 'flight_mode_pill.dart';
import 'fly_map_controls.dart';
import 'header_wind_pill.dart';
import 'map_search_controls.dart';
@@ -23,9 +24,11 @@ import 'map_search_controls.dart';
/// statt als PlanScreen-privates Feld, siehe dort.
///
/// Im Fly-Modus traegt sie stattdessen die Wind-Pille (Doku 7.2: "Wind-
/// Anzeige nach Hoehe interpoliert") und die Flugmodus-Auswahl (Doku 3.11,
/// HTML-Demonstrator: #flightModePill) - Ortssuche/Home/Fit sind dort
/// nicht relevant, da im Fly-Modus keine Missionsbearbeitung stattfindet.
/// Anzeige nach Hoehe interpoliert), die Flugmodus-Auswahl (Doku 3.11,
/// HTML-Demonstrator: #flightModePill) sowie Fit-/Drohnen-Zoom-Buttons
/// (FlyMapControls) - Ortssuche/Home entfallen dort, da im Fly-Modus keine
/// Missionsbearbeitung stattfindet und "Home" (erster Wegpunkt) waehrend
/// des Flugs kein sinnvoller Bezugspunkt mehr ist.
class TopModeBar extends ConsumerWidget {
const TopModeBar({super.key});
@@ -81,6 +84,8 @@ class TopModeBar extends ConsumerWidget {
const SizedBox(width: 8),
const Expanded(child: FlightModePill()),
const SizedBox(width: 8),
const FlyMapControls(),
const SizedBox(width: 8),
] else ...[
const SizedBox(width: 8),
const HeaderWindPill(),