'how to retrieve map of map object data from firebase
I am trying to retrieve the values of doctors map object as list of {times, email} for a specific date.
this is the code i have tried so far:
Stream<List> fromDateToList(int day, int month, int year){
var val = usersInfoCollection
.doc(uid).get();
Map<String, dynamic> data = {};
return usersInfoCollection
.doc(uid)
.snapshots()
.map((doc) {
if (doc['doctors'] is Map) {
return doc['doctors'].values.toList();
} else {
return [];
}
});
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

