'How can i filtering longitude-latitudeusing .where [duplicate]

i am building application which needs the distance between users .

now i already handled lon-lati from users then i save these data to Firstore but couldn't filter the lati-lon using .where .

ok lets say my lati-lon is 28.9496234-28.9417234 and someone else has difference lati-lonlets see 29.2469845-28.2496128 and every value has it's own field in firstore one for lati and one for lon at the same user doc . now i need to use .wherebased on wanted distance lets see i need to display on listview the users which they has not more than 20km between me and them

i have this method which handle the distance betwwen two users

Geolocator.distanceBetween(lon , lati , lon , lati) 

this methood doin well into app but How can i use it into .wherefor specific values

double lati = 28.9417234
double long = 28.9417234

FirebaseFirestore.instance.collection('users').where('???',???).get() // here i need to fitter the users who have 20km as distance betwwen. based in previous lati-long  

and the data look like following

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source