MSP protocol implementation and settings menu
This commit is contained in:
@@ -19,6 +19,7 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
required this.totalDistanceM,
|
||||
required this.totalDurationSec,
|
||||
required this.onTap,
|
||||
required this.onSettingsTap,
|
||||
this.warnings = const [],
|
||||
this.onWarningsTap,
|
||||
});
|
||||
@@ -28,6 +29,10 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
final double totalDurationSec;
|
||||
final VoidCallback onTap;
|
||||
|
||||
/// Oeffnet das Settings-Menue (runder Zahnrad-Knopf rechts der
|
||||
/// Details-Pille).
|
||||
final VoidCallback onSettingsTap;
|
||||
|
||||
/// Aktive Warnungen zur Mission (Doku 3.10) - der Button erscheint nur,
|
||||
/// solange diese Liste nicht leer ist (HTML-Demonstrator: #warningsBtn,
|
||||
/// per default versteckt).
|
||||
@@ -62,6 +67,7 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
label: 'Mission: $missionName',
|
||||
color: Colors.white.withValues(alpha: 0.12),
|
||||
textColor: Colors.white,
|
||||
maxWidth: 160,
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (_) => const MissionsDronesPanel.missions(),
|
||||
)),
|
||||
@@ -73,21 +79,32 @@ class BottomStatsBar extends ConsumerWidget {
|
||||
label: 'Drone: $droneName',
|
||||
color: const Color(0xFF4D9DFF).withValues(alpha: 0.18),
|
||||
textColor: const Color(0xFFCFE2FF),
|
||||
maxWidth: 140,
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (_) => const MissionsDronesPanel.drones(),
|
||||
)),
|
||||
),
|
||||
),
|
||||
if (warnings.isNotEmpty) ...[
|
||||
const SizedBox(width: 6),
|
||||
_WarningButton(onTap: onWarningsTap),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_detailsPill(),
|
||||
const Expanded(child: SizedBox.shrink()),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (warnings.isNotEmpty) ...[
|
||||
_WarningButton(onTap: onWarningsTap),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
_SettingsButton(onTap: onSettingsTap),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -168,25 +185,51 @@ class _WarningButton extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _NameChip extends StatelessWidget {
|
||||
const _NameChip({
|
||||
required this.label,
|
||||
required this.color,
|
||||
required this.textColor,
|
||||
required this.onTap,
|
||||
});
|
||||
/// Runder Zahnrad-Knopf rechts der Details-Pille - oeffnet das
|
||||
/// Settings-Menue (SettingsScreen).
|
||||
class _SettingsButton extends StatelessWidget {
|
||||
const _SettingsButton({required this.onTap});
|
||||
|
||||
final String label;
|
||||
final Color color;
|
||||
final Color textColor;
|
||||
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.white.withValues(alpha: 0.12),
|
||||
),
|
||||
child: const Icon(Icons.settings, color: Colors.white, size: 18),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _NameChip extends StatelessWidget {
|
||||
const _NameChip({
|
||||
required this.label,
|
||||
required this.color,
|
||||
required this.textColor,
|
||||
required this.onTap,
|
||||
required this.maxWidth,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final Color color;
|
||||
final Color textColor;
|
||||
final VoidCallback onTap;
|
||||
final double maxWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 130),
|
||||
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user