diff --git a/example/lib/pages/camera.dart b/example/lib/pages/camera.dart index a5f5dea3..ee1c9380 100644 --- a/example/lib/pages/camera.dart +++ b/example/lib/pages/camera.dart @@ -119,7 +119,11 @@ class _CameraPageState extends ExamplePageState { @override void dispose() { if (_navigationRunning) { - GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); } super.dispose(); } diff --git a/example/lib/pages/multiple_views.dart b/example/lib/pages/multiple_views.dart index 279c346c..c3088641 100644 --- a/example/lib/pages/multiple_views.dart +++ b/example/lib/pages/multiple_views.dart @@ -82,7 +82,11 @@ class _MultiplexState extends ExamplePageState { @override void dispose() { - GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); clearRegisteredImages(); super.dispose(); } diff --git a/example/lib/pages/navigation.dart b/example/lib/pages/navigation.dart index 16fe3bd9..2cce76f0 100644 --- a/example/lib/pages/navigation.dart +++ b/example/lib/pages/navigation.dart @@ -170,7 +170,11 @@ class _NavigationPageState extends ExamplePageState { @override void dispose() { _clearListeners(); - GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); clearRegisteredImages(); super.dispose(); } @@ -623,7 +627,11 @@ class _NavigationPageState extends ExamplePageState { // Cleanup navigation session. // This will also clear destinations, stop simulation, stop guidance - await GoogleMapsNavigator.cleanup(); + await GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); await _removeNewWaypointMarker(); await _removeDestinationWaypointMarkers(); _waypoints.clear(); diff --git a/example/lib/pages/navigation_without_map.dart b/example/lib/pages/navigation_without_map.dart index 436dc9ff..6d471170 100644 --- a/example/lib/pages/navigation_without_map.dart +++ b/example/lib/pages/navigation_without_map.dart @@ -110,7 +110,11 @@ class _NavigationWithoutMapPageState } Future cleanupNavigationSession() async { - await GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); setState(() { routeCalculated = false; guidanceRunning = false; diff --git a/example/lib/pages/turn_by_turn.dart b/example/lib/pages/turn_by_turn.dart index 9e5b26bd..79b70244 100644 --- a/example/lib/pages/turn_by_turn.dart +++ b/example/lib/pages/turn_by_turn.dart @@ -130,7 +130,11 @@ class _TurnByTurnPageState extends ExamplePageState { void dispose() { _clearListeners(); if (_navigationRunning) { - GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); } super.dispose(); } diff --git a/example/lib/pages/widget_initialization.dart b/example/lib/pages/widget_initialization.dart index 62e82820..2b905612 100644 --- a/example/lib/pages/widget_initialization.dart +++ b/example/lib/pages/widget_initialization.dart @@ -70,7 +70,11 @@ class _ViewInitializationPageState @override void dispose() { if (_navigationInitialized) { - GoogleMapsNavigator.cleanup(); + GoogleMapsNavigator.cleanup().catchError((e) { + if (e is! SessionNotInitializedException) { + debugPrint('Navigator cleanup error: $e'); + } + }); } super.dispose(); }