0

I am using firebase "cloud_firestore: ^0.14.3+1" with my flutter app and ım traying to get data from firebase, but ..data["name] code not working. how can I fix that?

enter image description here

 Widget searchList(){ return ListView.builder( itemCount: searchSnapshot.docs.length, itemBuilder: (context, index){ return SearchTile( userName: searchSnapshot.docs[index].data["name"], userEmail: searchSnapshot.docs[index].data["email"], ); }); } 

1 Answer 1

1

do it like this. you need to call data()['fieldName']

 return SearchTile( userName: searchSnapshot.docs[index].data()["name"], userEmail: searchSnapshot.docs[index].data()["email"], ); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.