diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-01 10:38:25 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-01 10:38:25 +0100 |
| commit | cfe52b8e397deb03a63dccd8dfd754e38d9b8a85 (patch) | |
| tree | 1724118c9ce03edd137e22589a617a985121536a /lib/pages/navigation_page.dart | |
| parent | 03bd15045beee64dab5795053b662d02f7049e31 (diff) | |
force orientation, fix labels, hide bars when navigating
Diffstat (limited to 'lib/pages/navigation_page.dart')
| -rw-r--r-- | lib/pages/navigation_page.dart | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/pages/navigation_page.dart b/lib/pages/navigation_page.dart index f4042fc..16494b5 100644 --- a/lib/pages/navigation_page.dart +++ b/lib/pages/navigation_page.dart @@ -1,4 +1,6 @@ import 'dart:async'; +import 'package:auto_orientation/auto_orientation.dart'; +import 'package:flutter/services.dart'; import 'package:training_planner/route.dart' as DHLRoute; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; @@ -21,6 +23,7 @@ import 'package:here_sdk/core.dart'; import 'package:here_sdk/core.engine.dart'; import 'package:here_sdk/core.errors.dart'; import 'package:here_sdk/mapview.dart'; +import 'package:wakelock/wakelock.dart'; class NavigationPage extends StatefulWidget { @override @@ -69,6 +72,10 @@ class _NavigationPageState extends State<NavigationPage> { initState() { super.initState(); + SystemChrome.setEnabledSystemUIOverlays([]); + Wakelock.enable(); + AutoOrientation.portraitDownMode(); + _handleLocationPermission(); panGestureEvent = eventBus.on<MapPanningEvent>().listen((event) { @@ -263,6 +270,10 @@ class _NavigationPageState extends State<NavigationPage> { panGestureEvent?.cancel(); taskLoadedEvent?.cancel(); _routingExample?.destroy(); + Wakelock.disable(); + AutoOrientation.portraitUpMode(); + SystemChrome.setEnabledSystemUIOverlays( + [SystemUiOverlay.top, SystemUiOverlay.bottom]); super.dispose(); } } |
