beerstorm-net / GeoFlutterFire2

🔥GeoFlutterFire2🔥 is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://pub.dev/packages/geoflutterfire2
MIT License
14 stars 34 forks source link

How properly use functionality without leaks? withinAsSingleStreamSubscription #33

Open irizzaflutter opened 1 year ago

irizzaflutter commented 1 year ago

/// !WARNING! This causes memory leaks because under the hood rxdart StreamController /// never causes it's subscriptions to be cancelled. So, even you cancel stream /// subscription created from this method, under the hood listeners are still working.

.within()

when I try to replace it with .withinAsSingleStreamSubscription()

Stream<List> stream = geo.collection(collectionRef: collectionReference) .withinAsSingleStreamSubscription(center: center, radius: radius, field: field);

its return me that

withinAsSingleStreamSubscription isn't defined for the class 'GeoFireCollectionRef'

irizzaflutter commented 1 year ago

case: when user will scroll map it will show only nearest points with selected radius

e.x when i open map i will get my current location, than i scroll to another city and in that case i need fetch only points from new city with radius N