How can I put retrieved data from firebase to a widget in Flutter?
问题 final String uid; final firestoreInstance = Firestore.instance; void printData() async{ var firebaseUser = await FirebaseAuth.instance.currentUser(); firestoreInstance.collection("users").document(firebaseUser.uid).get().then((value){ print(value.data); }); } So this function prints to console the retrieved data from firebase firestore when I press the button. But I want to put them into a widget and display them in my app. For ex: Text(printData()) - but it's not allowed. How can I do that?