DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 261 forks source link

No distance field bundled in with .data #87

Closed Sam-Guru-In-Training closed 3 years ago

Sam-Guru-In-Training commented 4 years ago

Yes, doesn't appear to be passed in, I'm having to use the Utility method .distance on the GeoFire object. Would be much cooler to just have it there with the snapshot data.

webertim commented 4 years ago

Same issue here. After having a quick look at the source code it seems pretty wasted to call the distance method again, since it is already called in the 'within' method. Would be great to have another within method which returns a Stream of DistanceDocumentSnapshots right away.

EDIT: Created a pull request with a new method 'withinWithDistance' which includes the distance. #88

RodoHS commented 4 years ago

@DarshanGowda0 will @webertim 's pull request be merged anytime soon? would be nice to have access to the distance parameter as standard in this package. Thank you

giorgio79 commented 4 years ago

Patch works great for me @DarshanGowda0

Stijnp commented 4 years ago

Also very keen on this feature!

awaik commented 3 years ago

In the version https://pub.dev/packages/geoflutterfire/versions/3.0.0-nullsafety.2 it should work.