Files
dmc/app/lib/ui/widgets/mission_footer_bar.dart
T
Constantin LeueandClaude Sonnet 5 310d92f187 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>
2026-07-30 07:45:36 +02:00

82 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import '../../domain/mission/mission_warnings.dart';
import '../../domain/waypoint/flat_waypoint_list.dart';
import 'bottom_stats_bar.dart';
import 'mini_altitude_profile.dart';
/// Gemeinsamer Fusszeilen-Aufbau (Warnungsbanner + Hoehenprofil +
/// BottomStatsBar), geteilt zwischen Plan- und Fly-Modus (Doku 3.9/3.10) -
/// beide zeigen dieselbe Missionsuebersicht, nur Reticle/Draeder gibt es
/// ausschliesslich im Plan-Modus.
class MissionFooterBar extends StatelessWidget {
const MissionFooterBar({
super.key,
required this.waypoints,
required this.legClimbBad,
required this.vertexBad,
required this.activeIndex,
required this.totalDistanceM,
required this.totalDurationSec,
required this.warnings,
required this.onDetailsTap,
required this.onWarningsTap,
});
final List<Waypoint> waypoints;
final List<bool> legClimbBad;
final List<bool> vertexBad;
final int activeIndex;
final double totalDistanceM;
final double totalDurationSec;
final List<MissionWarning> warnings;
final VoidCallback onDetailsTap;
final VoidCallback onWarningsTap;
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (warnings.isNotEmpty)
Container(
width: double.infinity,
color: const Color(0xFF7C2D12),
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 12),
child: Text(
warnings.map((w) => w.text).join(' · '),
textAlign: TextAlign.center,
style: const TextStyle(color: Color(0xFFFDE3D0), fontSize: 12),
),
),
Container(
width: double.infinity,
color: const Color(0xFF0F0F0F).withValues(alpha: 0.72),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(8, 6, 8, 0),
child: MiniAltitudeProfile(
waypoints: waypoints,
legClimbBad: legClimbBad,
vertexBad: vertexBad,
activeIndex: activeIndex,
),
),
BottomStatsBar(
waypointCount: waypoints.length,
totalDistanceM: totalDistanceM,
totalDurationSec: totalDurationSec,
onTap: onDetailsTap,
warnings: warnings,
onWarningsTap: onWarningsTap,
),
],
),
),
],
);
}
}