I need help with my flutter code which involves firebasefirestore. This is my code. I'd like to retrieve from the database the image_url from the map.
final userData = FirebaseFirestore.instance
.collection('users')
.doc(FirebaseAuth.instance.currentUser.uid)
.get();
But in userData is not a map exactly. It is a Future<DocumentSnapshot<Map<String, dynamic>>>. This is what get returns . My question is, how do I scope into the Map<String, dynamic> ? I mean to get the userData['image_url']... ? Because I get this error: The operator '[]' isn't defined for the type 'Future<DocumentSnapshot<Map<String, dynamic>>>'. Thanks alot!