skip to Main Content

Flutter firebase: Bad state: field does not exist within the DocumentSnapshotPlatform

I'm getting this error: Bad state: field does not exist within the DocumentSnapshotPlatform with the following code: static List<Report?> reportListFromSnapshot(QuerySnapshot snapshot) { return snapshot.docs.map<Report?>((report) { return Report( type: report['type'], reason: report['reason'], reportId: report['id'], chat: (report['chat'] == null) ? null :…

VIEW QUESTION

How can I get a specific data in Firebase (Kotlin)

I need to retrieve the "administrator" value from Firebase This is the code I use: FirebaseDatabase.getInstance().getReference("/restaurants/$restaurantUID/administrator") .get().addOnSuccessListener { Log.d("key", it.toString()) } The result in the log is this though: 2022-09-05 17:07:32.271 2885-2885/com.example.menuapp D/key: DataSnapshot { key = administrator, value =…

VIEW QUESTION
Back To Top
Search