what is the error in this code? In console, I got error like this
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '_InternalLinkedHashMap' is not a subtype of type 'Iterable
class _MytimeoffState extends State<Mytimeoff> {
List<Map> list = [];
void getList() async {
var data = await http
.get('https://my-json-server.typicode.com/darshanaAlex/db2/time_off');
var jsonData = json.decode(data.body);
setState(() {
for (Map js in jsonData) {
list.add(js);
}
});
print(jsonData);
}
@override
void initState() {
super.initState();
getList();
}
@override
Widget build(BuildContext context) {
return Scaffold();
}
}
