Closed marcotrumpet closed 1 year ago
Can we detect when the route is not done and prevent that until the final leg?
Not sure.. but it will not be the right behavior in my opinion. Maybe I want to restart the navigation or start another one in the same embedded view, I should be able to re-listen to events or (better) not stop listening to them until I'm in the navigation view
I propose a fix
This is resolved with the PR and published in v0.1.9
following this https://github.com/eopeter/flutter_mapbox_navigation/blob/master/lib/src/embedded/controller.dart#L141C7-L141C7 the package calls '_routeEventSubscription.cancel()' when an 'on_arrival' event is forwarded from native. The problem is that native sends 'on_arrival' when the user reaches a waypoint, not only the end of the navigation.
PROBLEM: Every other event is lost because of that.
SOLUTION @eopeter my suggestion is to expose the subscription deletion to the app so we can call it when disposing of the specific page.