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 40 forks source link

Trying to create document with point.data freezes app #1

Closed One2mellow closed 3 years ago

One2mellow commented 3 years ago

saving only hash or geopoint to firestore works great but when i try to post the object of point.data it freezes my app and doesn't post to firestore

zeusbaba commented 3 years ago

thanks for your feedback @One2mellow

can u plz share code sample on how you are trying to persist point.data?

fyi. i've been using this package since long time, e.g. in LOC8
and here is an codesnippet of how i'm persisting into Firestore. plz let me know if this helps.

CollectionReference collectionReference = FirebaseFirestore.instance.collection("mylocs");

GeoFlutterFire _geoflutterfire = GeoFlutterFire();  
GeoFirePoint geoFirePoint = _geoflutterfire.point(latitude: loc8item.latitude, longitude: loc8item.longitude);

Map<String, dynamic> toSave = Map<String, dynamic>(); 
toSave['id'] = 'userid';  
// etc etc  
toSave['geofire'] = geoFirePoint.data; // this is to enable geoquerying!!!
await collectionReference.add(toSave);
zeusbaba commented 3 years ago

I didn't get any feedback from you @One2mellow , thus I assume that this issue is resolved.
Feel free to re-open this one or new issues if you need further help.