What is the difference between getCurrentPosition and PositionStream geolocator flutzer

47 views Asked by At

I am using the geolocator package in my flutter app and I have some understanding issue. GetCurrentPosition gives back the device current position and PositionStream updates the device location continuously. So what is the difference between the two. Can I use only PositionStream? I want to track the device location at any time.

Thanks.

1

There are 1 answers

0
Jannik On BEST ANSWER

Use getCurrentPosition when you want to retrieve the position once and getPositionStream when you want to monitor the location over a time window. With getPositionStream you can adjust the distance a device has to travel or/and a timeout before the event is triggered. You can find the documentation here.