Files
dmc/app/lib/ui/widgets/nav_icon_button.dart
Constantin Leue 0d3dba2482 Unify header pill/button height to 38px, matching the HTML prototype
Measured the prototype screenshot pixel-for-pixel: content pills take
up ~79% of the header's total height, matching its own CSS
(height:38px, topBarWrap padding:5px 10px -> 48px total). The Flutter
port had drifted to 34px for HeaderWindPill, MapSearchControls, and
NavIconButton, while FlightModePill was left at the original 38px -
so Fly mode looked inconsistent against itself, and both modes wasted
more header height as margin than the prototype does. Bringing all
four back to a shared 38px fixes both.
2026-08-07 22:06:23 +02:00

46 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
/// Runder Icon-Button ueber dunklem Kartenhintergrund, geteilt zwischen den
/// Plan- (MapSearchControls: Home/Fit) und Fly-Modus-Kartensteuerungen
/// (FlyMapControls: Drohne/Fit).
class NavIconButton extends StatelessWidget {
const NavIconButton({
super.key,
this.icon,
this.iconWidget,
required this.onTap,
}) : assert(
icon != null || iconWidget != null,
'Entweder icon oder iconWidget angeben.',
);
final IconData? icon;
/// Individuelles Icon-Widget statt eines Material-[IconData], z.B.
/// [DroneFollowIcon] fuer den Kartenfolge-Knopf (FlyMapControls). Hat
/// Vorrang vor [icon], falls beides gesetzt ist.
final Widget? iconWidget;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
// 38 statt vorher 34, deckungsgleich mit HeaderWindPill/
// MapSearchControls/FlightModePill (Nutzerwunsch: einheitliche
// Kopfleisten-Hoehe wie im HTML-Demonstrator vermessen: #homeBtn/
// #fitBtn nutzen dort ebenfalls width/height:38px).
width: 38,
height: 38,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black.withValues(alpha: 0.55),
),
child: iconWidget ?? Icon(icon, color: Colors.white, size: 16),
),
);
}
}