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>
This commit is contained in:
Constantin Leue
2026-07-27 07:27:15 +02:00
co-authored by Claude Sonnet 5
parent 91a7e5cd2d
commit 02dd1bc11a
7 changed files with 137 additions and 7 deletions
@@ -1,4 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Fuer OSM-Kartenkacheln, Wind-/Terrain-APIs und die WiFi/TCP-Verbindung
zum Flightcontroller (Doku 4.1) auch im Release-Build noetig. -->
<uses-permission android:name="android.permission.INTERNET"/>
<application <application
android:label="dmc_app" android:label="dmc_app"
android:name="${applicationName}" android:name="${applicationName}"
@@ -8,6 +11,7 @@
android:exported="true" android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:taskAffinity="" android:taskAffinity=""
android:screenOrientation="sensorLandscape"
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
+12 -1
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@@ -9,7 +10,17 @@ import 'ui/dmc_colors.dart';
import 'ui/screens/library/library_screen.dart'; import 'ui/screens/library/library_screen.dart';
import 'ui/screens/settings/settings_screen.dart'; import 'ui/screens/settings/settings_screen.dart';
void main() { 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()); runApp(const DmcApp());
} }
+6 -3
View File
@@ -1,15 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../widgets/mission_map.dart';
/// Missionsplanung: Karte + Wegpunktliste (Architektur-Doku 3.6/3.7). /// Missionsplanung: Karte + Wegpunktliste (Architektur-Doku 3.6/3.7).
/// Kartenintegration (flutter_map) und Fillet-Geometrie folgen als naechster /// Top-/Bottom-Bar-Overlays (Modus-Umschalter, Draeder, Wegpunktliste) folgen
/// Schritt - dies ist bewusst nur der Screen-Platzhalter. /// als naechster Schritt - dies ist bewusst erst die Vollbild-Karte.
class PlanScreen extends StatelessWidget { class PlanScreen extends StatelessWidget {
const PlanScreen({super.key}); const PlanScreen({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Scaffold( return const Scaffold(
body: Center(child: Text('Plan')), extendBodyBehindAppBar: true,
body: MissionMap(),
); );
} }
} }
+43
View File
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:url_launcher/url_launcher.dart';
/// Vollbild-OSM-Karte, entspricht dem Leaflet-`#map` im HTML-Demonstrator:
/// randlos, ohne Zoom-Buttons (Pinch-to-Zoom/Pan reicht), Standard-OSM-Tiles.
class MissionMap extends StatelessWidget {
const MissionMap({super.key, this.mapController});
final MapController? mapController;
// Default-Zentrum/Zoom uebernommen aus dem HTML-Demonstrator
// (Drone Mission Control.html: L.map(...).setView([52.3676, 4.9041], 16)).
static const _initialCenter = LatLng(52.3676, 4.9041);
static const _initialZoom = 16.0;
@override
Widget build(BuildContext context) {
return FlutterMap(
mapController: mapController,
options: const MapOptions(
initialCenter: _initialCenter,
initialZoom: _initialZoom,
minZoom: 3,
maxZoom: 19,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'de.dmc.dmc_app',
maxZoom: 19,
),
SimpleAttributionWidget(
alignment: Alignment.bottomLeft,
source: const Text('OpenStreetMap contributors'),
onTap: () =>
launchUrl(Uri.parse('https://www.openstreetmap.org/copyright')),
),
],
);
}
}
+65 -1
View File
@@ -917,6 +917,70 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.9" version: "1.1.9"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
url: "https://pub.dev"
source: hosted
version: "6.3.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: b413d49b73867ac08dd2f9890efd3cc11f2a0e577618d50843440a1fb3776c32
url: "https://pub.dev"
source: hosted
version: "6.3.32"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0"
url: "https://pub.dev"
source: hosted
version: "6.4.1"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a
url: "https://pub.dev"
source: hosted
version: "3.2.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
url: "https://pub.dev"
source: hosted
version: "3.2.5"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34"
url: "https://pub.dev"
source: hosted
version: "2.4.3"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"
url: "https://pub.dev"
source: hosted
version: "3.1.5"
uuid: uuid:
dependency: transitive dependency: transitive
description: description:
@@ -1015,4 +1079,4 @@ packages:
version: "3.1.3" version: "3.1.3"
sdks: sdks:
dart: ">=3.12.2 <4.0.0" dart: ">=3.12.2 <4.0.0"
flutter: ">=3.38.4" flutter: ">=3.44.0"
+1
View File
@@ -50,6 +50,7 @@ dependencies:
flutter_bloc: ^9.1.1 flutter_bloc: ^9.1.1
flutter_riverpod: ^3.4.1 flutter_riverpod: ^3.4.1
go_router: ^17.3.0 go_router: ^17.3.0
url_launcher: ^6.3.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
+6 -2
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@@ -7,7 +8,7 @@ import 'package:dmc_app/app_mode/app_mode_cubit.dart';
import 'package:dmc_app/ui/app_shell.dart'; import 'package:dmc_app/ui/app_shell.dart';
void main() { void main() {
testWidgets('AppShell zeigt Plan-Screen im Startzustand', (tester) async { testWidgets('AppShell zeigt die Karte im Plan-Startzustand', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
ProviderScope( ProviderScope(
child: BlocProvider( child: BlocProvider(
@@ -16,7 +17,10 @@ void main() {
), ),
), ),
); );
// Nur ein Frame pumpen statt pumpAndSettle: TileLayer laedt echte
// Netzwerk-Kacheln, die in der Testumgebung nie ankommen.
await tester.pump();
expect(find.text('Plan'), findsOneWidget); expect(find.byType(FlutterMap), findsOneWidget);
}); });
} }