1

How do I find the nearest location from the driver and passenger latitude and longitude collections on Flutter? I use Firebase to store latitude and longitude.

I have a list of drivers with their source/destination latitude and longitude stored and known. There is also a list of riders whose source/destination latitude and longitude are also known.

Now let's assume the rider asks for a ride. Then the driver's list should appear in front of him. This list should contain only suitable drivers/drivers based on the source and destination latitude and longitude of the driver and passenger.

So, basically I'm trying to sift through drivers and find the right driver for the rider.

My Car
  • 4,198
  • 5
  • 17
  • 50

1 Answers1

0

What you're looking for is done by the GeoFire libraries that Firebase provides for iOS, Android, and JavaScript. See my answer here for a longer explanation: Query for nearby locations

There seem to be some Flutter versions of the library too:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807