From 38ae95255e5f5c1fc2418aeb2ca229cca1071752 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Fri, 4 Nov 2022 21:43:39 +0100 Subject: working uwu --- lib/pages/navigation_page.dart | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) (limited to 'lib/pages') diff --git a/lib/pages/navigation_page.dart b/lib/pages/navigation_page.dart index 58ea307..531395e 100644 --- a/lib/pages/navigation_page.dart +++ b/lib/pages/navigation_page.dart @@ -85,6 +85,11 @@ class _NavigationPageState extends State { _routingExample?.changeZoom(_routingExample!.currentZoom - 1); } + void _mockStopComplete() { + _routingExample?.routeSectionCursor++; + _routingExample?.updateHighlightedRouteSections(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -94,6 +99,10 @@ class _NavigationPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ + FloatingActionButton( + onPressed: () => _mockStopComplete(), + child: Icon(Icons.check_circle), + ), Visibility( visible: _routingExample == null ? false @@ -112,6 +121,7 @@ class _NavigationPageState extends State { onPressed: () => _zoomOut(), child: Icon(Icons.zoom_out), ), + Padding(padding: EdgeInsets.all(2)), FloatingActionButton( onPressed: () => _zoomIn(), child: Icon(Icons.zoom_in), @@ -132,7 +142,9 @@ class _NavigationPageState extends State { (MapError? error) { if (error == null) { _routingExample = RoutingExample(hereMapController); - _routingExample?.addRoute(); + routeProvider + .getRoute(0) + .then((value) => _routingExample?.addRoute(value)); } else { print("Map scene not loaded. MapError: " + error.toString()); } @@ -149,32 +161,4 @@ class _NavigationPageState extends State { _routingExample?.timer?.cancel(); super.dispose(); } - - // A helper method to show a dialog. - Future _showDialog(String title, String message) async { - return showDialog( - context: context, - barrierDismissible: false, - builder: (BuildContext context) { - return AlertDialog( - title: Text(title), - content: SingleChildScrollView( - child: ListBody( - children: [ - Text(message), - ], - ), - ), - actions: [ - TextButton( - child: Text('OK'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } } -- cgit v1.2.3-70-g09d2