eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
217 stars 187 forks source link

Route Events not arriving anymore #287

Closed marcotrumpet closed 1 year ago

marcotrumpet commented 1 year ago

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.

eopeter commented 1 year ago

Can we detect when the route is not done and prevent that until the final leg?

marcotrumpet commented 1 year ago

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

marcotrumpet commented 1 year ago

I propose a fix

eopeter commented 1 year ago

This is resolved with the PR and published in v0.1.9