Home > Mobile >  How to get data from inside document in firestore
How to get data from inside document in firestore

Time:03-20

i am getting data from inside Doucument in firestor

enter image description here

CodePudding user response:

your code isn't clear but if your questionSnapShot is a DocumentSnapshot you can retrieve the data whiteout adding .data(), so just remove .data() if that's the case.

CodePudding user response:

If I‘d have to guess, I‘d say that you have a problem with null safety.

You can check beforhand if .data() is null or just add !

questionSnapshotData = questionSnapshot.data()!["question1"];

https://dart.dev/null-safety

  • Related