String title = '';
child: GestureDetector(
onTap: () {
setState(
() {
final docRef = FirebaseFirestore.instance
.collection('CIPsubmit')
.doc(wee)
.get()
.then(
(DocumentSnapshot doc) {
final data = doc.data() as Map<String, dynamic>;
final title = data['title'];
print(title.toString());
},
);
},
);
},
I am getting a string from firebase, and have put it in a setState to change a text value. The print shows that String title has updated to the right value, but the text is not changing.