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

Cloud firestore 2.x #3

Closed damda58 closed 3 years ago

damda58 commented 3 years ago

Hello, Since the update of cloud firestore the format of the documentsnapshot has changed. I can no longer extract my data. could you help me? Thank you updated

image

zeusbaba commented 3 years ago

hello @damda58 , here is a code snippet you can adapt for your need. let me know if that helps or if you have any further questions.

 // this is the snap data you get from firestore  
...utilisateur...

Map<String, dynamic> snapData = utilisateur.exists ? utilisateur.data() : Map(); 

// now you can read any value from snapData for it is a Map  
// for example   
snapData.containsKey('id') ? snapData['id'] as String : '';  
damda58 commented 3 years ago

Thanks a lot for your help ! it works wonderfully

zeusbaba commented 3 years ago

sounds good, you welcome