Support for Cloud Firestore type annotation and withConverter method
Problem: The last version of the package did not work well with the new Repository<T> and Query<T> types, because the code was not type annotated. Also, it couldn't work with the withConverter method from the cloud_firestore package.
Solution: The code was refactored to add type annotation and another class was created to both:
Maintain compatibility with the last version
Enable users to use the package with the withConverter method with little to no change. As explained in the README, the GeoFireCollectionWithConverterRef<T> class can be used instead of the original GeoFireCollectionRef with the only change needed to within method that now requires an extra parameter to actually get the GeoPoint from the T class.
Minor Tweaks
Linting was added and the warnings were resolved
Static types were prioritized instead of dynamic types
Create withinWithDistance method that returns the DocumentSnapshot with the calculated distance (to avoid recalculations)
Support for Cloud Firestore type annotation and
withConverter
methodRepository<T>
andQuery<T>
types, because the code was not type annotated. Also, it couldn't work with thewithConverter
method from thecloud_firestore
package.withConverter
method with little to no change. As explained in the README, theGeoFireCollectionWithConverterRef<T>
class can be used instead of the originalGeoFireCollectionRef
with the only change needed towithin
method that now requires an extra parameter to actually get theGeoPoint
from theT
class.Minor Tweaks
withinWithDistance
method that returns the DocumentSnapshot with the calculated distance (to avoid recalculations)I would love to hear your feedbacks. :)