skip to Main Content

Why i cant see the values of my snapshot.value from firebase database in a Text widget in flutter?

i have the next code: DatabaseReference ref = FirebaseDatabase.instance.ref(); late DatabaseReference databaseReference; final data = FirebaseDatabase.instance.ref(); var medsValues; _activateListeners() { data.get().then((snapshot) { var medsDescription = snapshot.value; setState(() { medsValues = medsDescription; }); }); } ListView.builder( itemCount: medsValues.length, itemBuilder: (BuildContext context,…

VIEW QUESTION

Firebase – Flutter: type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast

Im trying to make a list ti json for firestore, and have the following code: static Map<String, dynamic> toJson(Message? message) => { 'id': message?.id, 'senderId': message?.senderId, 'receiverId': message?.receiverId, 'message': message?.message, 'dateTime': message?.dateTime, 'timeString': message?.timeString, 'likes': message?.likes, 'chatId': message?.chatId, 'commentCount': message?.commentCount,…

VIEW QUESTION
Back To Top
Search