Footer: drone status pill always sizes to its content, mission pill absorbs the rest

The drone status pill and the mission pill previously sat in two equally
sized Expanded regions. That squeezed the drone pill's FittedBox down to
illegibility whenever its content grew (e.g. "disconnected"), while the
mission pill often had unused space to spare.

A plain flex-ratio rebalance (e.g. mission flex:1 vs drone flex:4) turned
out to be the wrong tool: Expanded/Flexible always force a fixed
fractional share regardless of actual content need, so it either starved
the mission pill even for short names, or capped the drone pill below
what it needed.

bottom_stats_bar.dart: the drone-side content (status pill or drone-name
chip + send/warning/settings buttons) is now a plain, non-flex Row child,
exactly like _detailsPill()/_AltitudeProfileToggleButton already were -
it always gets exactly the width its current content needs, never more,
never less. The mission pill remains the sole Expanded element and
absorbs whatever space is left, ellipsizing first if it's tight.

widget_test.dart: two tests exercising the footer at the default 800x600
test viewport started hitting a real RenderFlex overflow, since that
width was never realistic for this landscape-only app's footer content
in the first place (previously masked by the drone pill silently
shrinking via FittedBox). Set a realistic device-sized viewport
(2424x1080, matching the Pixel_10a emulator) for just those two tests.

Verified on the Pixel_10a emulator: "disconnected" now renders fully
legible in the drone pill, and the mission pill still reads normally
alongside it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Constantin Leue
2026-08-06 21:35:19 +02:00
co-authored by Claude Sonnet 5
parent 1b92e6a452
commit 7ff88c5435
2 changed files with 79 additions and 57 deletions
+19
View File
@@ -1003,6 +1003,18 @@ void main() {
testWidgets(
'Warnungs-Button erscheint bei Reichweiten-Ueberschreitung und oeffnet die Warnungsliste',
(tester) async {
// Realistische (landschaftsbreite) Viewport-Groesse statt der 800x600-
// Standardvorgabe von flutter_test - die Fusszeile (BottomStatsBar)
// reiht mehrere intrinsisch grosse Pillen/Knoepfe nebeneinander (Doku:
// "darauf achten dass drone status immer auf seinen inhalt skaliert"),
// was bei 800px Breite selbst im Plan-Modus zu einem echten
// RenderFlex-Overflow fuehrt - auf jedem real relevanten Geraet (dieses
// Projekt ist landscape-only) ist dafuer genug Platz.
tester.view.physicalSize = const Size(2424, 1080);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
final container = _testContainer();
addTearDown(container.dispose);
@@ -1187,6 +1199,13 @@ void main() {
testWidgets(
'Antippen einer Speed-Warnung oeffnet die Wegpunktliste direkt auf dem Speed-Tab',
(tester) async {
// Realistische (landschaftsbreite) Viewport-Groesse statt der 800x600-
// Standardvorgabe - siehe Kommentar beim vorigen Warnungs-Button-Test.
tester.view.physicalSize = const Size(2424, 1080);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
final container = _testContainer();
addTearDown(container.dispose);