90 lines
2.9 KiB
Dart
90 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../../domain/mission/mission_warnings.dart';
|
|
import '../../domain/waypoint/flat_waypoint_list.dart';
|
|
import '../providers/altitude_profile_provider.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 ConsumerWidget {
|
|
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,
|
|
required this.onSettingsTap,
|
|
});
|
|
|
|
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;
|
|
final VoidCallback onSettingsTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final isExpanded = ref.watch(altitudeProfileExpandedProvider);
|
|
|
|
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: [
|
|
if (isExpanded)
|
|
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,
|
|
onSettingsTap: onSettingsTap,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|