How to convert such a Map:
Map<dynamic, dynamic> a = {2022-04-10: [8:00, 15:00]}; //No quotes
To obtain:
Map<String, List<String>> b = {"2022-04-10": ["8:00", "15:00"]};
I tried to do so, but it doesn't work for me. There is no error, but if you call print, nothing happens:
String str = '{2022-04-10: [8:00, 15:00]}';
final Map<dynamic, dynamic> dynamicMapFromJson = json.decode(str);
Map<String, List<String>> schedule = dynamicMapFromJson.cast<String, List<String>>();
I am teaching this Map from Firebase:
await FirebaseFirestore.instance
.collection('call')
.get()
.then((QuerySnapshot querySnapshot) {
for (var doc in querySnapshot.docs) {
Map<String, List<String>> _schedule = doc.get('schedule');
}
});

String str = '{"2022-04-10": ["8:00", "15:00"]}';on response string?