beerstorm-net/GeoFlutterFire2

Cloud firestore 2.x

Closed this issue · 3 comments

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

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 : '';  

Thanks a lot for your help ! it works wonderfully

sounds good, you welcome