Skip to content

update distanceFilter and intervalDuration not work #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tranice opened this issue Apr 5, 2021 · 2 comments
Closed

update distanceFilter and intervalDuration not work #703

tranice opened this issue Apr 5, 2021 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@tranice
Copy link

tranice commented Apr 5, 2021

🐛 Bug Report

First:
StreamSubscription _positionStream = Geolocator.getPositionStream(
forceAndroidLocationManager: true,
desiredAccuracy: LocationAccuracy .best,
distanceFilter:100,
intervalDuration: Duration(seconds: 2),
).listen((Position position) {
......
});

then:
await _positionStream .cancel();
_positionStream =null;

and:
_positionStream = Geolocator.getPositionStream(
forceAndroidLocationManager: true,
desiredAccuracy: LocationAccuracy .best,
distanceFilter:10, /change/
intervalDuration: Duration(seconds: 3), /change/
).listen((Position position) {
......
});

/* new distanceFilter and intervalDuration not working, still use last ones , if restart app ,everything return to normal*/

Version: geolocator: ^7.0.1

Platform:

  • Android

both locations are in background and occur in real phone.

@florissmit1
Copy link
Contributor

I was able to reproduce this issue. The positionParameters are cached , thus the initial parameters are always used.

I mark the issue as a 'bug' since I think the parameters should be changeable after initializing a positionStream for the second time.

@florissmit1
Copy link
Contributor

The bug u mentioned is fixed, see #723. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants