Brightcode
Brightcode

Reputation: 768

How to auto update someone location (latitude and longitude) in flutter

If a user opens my app, am able to get his latitude, longitude and address using Geolocator and Geocoder and when someone search for people nearby i can calculate the distance using his last known updated location and show to someone else that he is nearby

double distanceInMeters = Geolocator.distanceBetween(52.2165157, 6.9437819, 52.3546274, 4.8285838);

but what I want to do is, is there a way to automatically get his lat and long even when he isn't using the app because if he/she changes location, his last location where he last opened the app will still be showing and this might cause some confusion. Please Is there a way to do this maybe from background.

Upvotes: 0

Views: 1646

Answers (1)

Related Questions