tlserver / flutter_map_location_marker

A flutter map plugin for displaying device current location.
https://pub.dev/packages/flutter_map_location_marker
BSD 3-Clause "New" or "Revised" License
102 stars 93 forks source link

improvement: re-create position stream on location settings change #14

Closed comatory closed 2 years ago

comatory commented 2 years ago

Resolves https://github.com/tlserver/flutter_map_location_marker/issues/13

It was not possible to change behaviour of the marker (distanceFilter) once the plugin was initialized. For example the marker would move at speed that was set when the plugin was initialized and if you'd pass updated LocationSettings object, the marker wouldn't react to new settings. This commit fixes that.

Creation of stream and stream listener were extracted into separate methods so they can be more easily re-used.

tlserver commented 2 years ago

Does this PR fix #15? It seem that #15 and #13 is some how the same problem? I am considering should I accept this PR to version 2 branch.

comatory commented 2 years ago

Does this PR fix #15? It seem that #15 and #13 is some how the same problem? I am considering should I accept this PR to version 2 branch.

This PR does not fix #15 but it fixes #13 . It wouldn't be bad idea to have it in v2 at least.

tlserver commented 2 years ago

Ok, I will pull this into v2. But I don't quite understand why this does not fix #15. Let's discuss in #15.