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:
co-authored by
Claude Sonnet 5
parent
91a7e5cd2d
commit
02dd1bc11a
+12
-1
@@ -1,4 +1,5 @@
|
||||
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';
|
||||
@@ -9,7 +10,17 @@ import 'ui/dmc_colors.dart';
|
||||
import 'ui/screens/library/library_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());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../widgets/mission_map.dart';
|
||||
|
||||
/// Missionsplanung: Karte + Wegpunktliste (Architektur-Doku 3.6/3.7).
|
||||
/// Kartenintegration (flutter_map) und Fillet-Geometrie folgen als naechster
|
||||
/// Schritt - dies ist bewusst nur der Screen-Platzhalter.
|
||||
/// Top-/Bottom-Bar-Overlays (Modus-Umschalter, Draeder, Wegpunktliste) folgen
|
||||
/// als naechster Schritt - dies ist bewusst erst die Vollbild-Karte.
|
||||
class PlanScreen extends StatelessWidget {
|
||||
const PlanScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Center(child: Text('Plan')),
|
||||
extendBodyBehindAppBar: true,
|
||||
body: MissionMap(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user