Files
dmc/app/lib/main.dart
T
Constantin LeueandClaude Sonnet 5 02dd1bc11a Lock app to landscape fullscreen and add first OSM map
- Lock orientation to landscape (sensorLandscape in the manifest,
  SystemChrome.setPreferredOrientations in main.dart) and enable immersive
  fullscreen, matching the prototype's full-bleed map UI (doc 7.7).
- Add MissionMap widget: flutter_map + standard OSM raster tiles, same
  default center/zoom as the HTML prototype (Amsterdam, zoom 16), OSM
  attribution bottom-left. PlanScreen now renders it full-screen instead of
  the placeholder text.
- Add the release-manifest INTERNET permission (previously only present in
  the debug manifest, which would have silently broken tile loading and any
  future network calls in release builds).
- Update the smoke test to check for the FlutterMap widget instead of the
  removed placeholder text.

Verified with flutter analyze, flutter test, and a real run on the
Pixel_10a emulator (fullscreen landscape confirmed, tiles loading).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 07:27:15 +02:00

67 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/services.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';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// App laeuft ausschliesslich im Landscape-Vollbild (Prototyp-Referenz:
// Kartenansicht nutzt den gesamten Bildschirm ohne System-Chrome).
await SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
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,
),
),
);
}
}