42 lines
1.1 KiB
Dart
42 lines
1.1 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(
|
|
width: 34,
|
|
height: 34,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Colors.black.withValues(alpha: 0.55),
|
|
),
|
|
child: iconWidget ?? Icon(icon, color: Colors.white, size: 16),
|
|
),
|
|
);
|
|
}
|
|
}
|