Below is my flutter TextEditingController
TextEditingController displayName = TextEditingController();
when fetching document from firebase storage and assiging to the above controller, it throws an error called
Exception has occurred.
_TypeError (type 'String' is not a subtype of type 'TextEditingController')
FirebaseFirestore fireStoreRef = FirebaseFirestore.instance;
await fireStoreRef
.collection("profiles")
.doc(widget.userId)
.get()
.then((DocumentSnapshot doc) {
final data = doc.data() as Map<String, dynamic>;
setState(() {
displayName = data["displayName"] ?? '';
});
});
Can you please help me, what wrong i did here,