DeKekem
DeKekem

Reputation: 1743

What is the difference between getCurrentPosition and PositionStream geolocator flutzer

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.

Upvotes: 0

Views: 428

Answers (1)

Jannik
Jannik

Reputation: 467

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.

Upvotes: 1

Related Questions