Five-layer architecture per DMC_Architektur_und_Design.md: FlightControllerLink abstraction (Mock + MSP stub), protocol-neutral mission domain layer, App-Mode state machine with Ready-to-Fly gate, Drift persistence schema, and placeholder UI screens wired via go_router. App icon generated from design/Y2_pink_dark.svg. Verified with flutter analyze and flutter test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'app_mode/app_mode_cubit.dart';
|
|
import 'ui/app_shell.dart';
|
|
import 'ui/dmc_colors.dart';
|
|
import 'ui/screens/library/library_screen.dart';
|
|
import 'ui/screens/settings/settings_screen.dart';
|
|
|
|
void main() {
|
|
runApp(const DmcApp());
|
|
}
|
|
|
|
final _router = GoRouter(
|
|
routes: [
|
|
GoRoute(path: '/', builder: (context, state) => const AppShell()),
|
|
GoRoute(
|
|
path: '/settings',
|
|
builder: (context, state) => const SettingsScreen(),
|
|
),
|
|
GoRoute(
|
|
path: '/library',
|
|
builder: (context, state) => const LibraryScreen(),
|
|
),
|
|
],
|
|
);
|
|
|
|
class DmcApp extends StatelessWidget {
|
|
const DmcApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ProviderScope(
|
|
child: BlocProvider(
|
|
create: (_) => AppModeCubit(),
|
|
child: MaterialApp.router(
|
|
title: 'Drone Mission Control',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
scaffoldBackgroundColor: const Color(0xFF0F0F0F),
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: DmcColors.setBlue,
|
|
brightness: Brightness.dark,
|
|
),
|
|
),
|
|
routerConfig: _router,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|