Home > Software engineering >  how can I access "petName" of each document and store in dropdownbutton
how can I access "petName" of each document and store in dropdownbutton

Time:05-17

I need to retrieve data from Firestore to get "petName" of each document and then I used in dropdownbutton. But problem is that I am not getting any field . I received only documents. As also show in output dropdownbutton.

picture 1 picture 2 picture 3

CodePudding user response:

you are using document you have to specify what exactly like as in your case you want petName so use that instead of using the whole document.

try:

snap.data()['petName']
  • Related