diff --git a/example/lib/pages/camera.dart b/example/lib/pages/camera.dart index 6ee94d2..1c1db08 100644 --- a/example/lib/pages/camera.dart +++ b/example/lib/pages/camera.dart @@ -120,7 +120,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 02ac076..858fa70 100644 --- a/example/lib/pages/multiple_views.dart +++ b/example/lib/pages/multiple_views.dart @@ -80,7 +80,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 1baef64..30c78a8 100644 --- a/example/lib/pages/navigation.dart +++ b/example/lib/pages/navigation.dart @@ -156,7 +156,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(); } @@ -555,7 +559,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 05a9d9d..3a971e9 100644 --- a/example/lib/pages/navigation_without_map.dart +++ b/example/lib/pages/navigation_without_map.dart @@ -101,7 +101,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 847d27d..965dcf9 100644 --- a/example/lib/pages/turn_by_turn.dart +++ b/example/lib/pages/turn_by_turn.dart @@ -134,7 +134,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 9456390..c02fb6c 100644 --- a/example/lib/pages/widget_initialization.dart +++ b/example/lib/pages/widget_initialization.dart @@ -68,7 +68,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(); }