I want to parse this Json. Now i am parsing Load as a class with 2 fields: id, and value. But what i want to is to parse it like Map<int, String>. When i am trying to cast the object, flutter gives me an error. for example:
Map<int, String> map = {
38 : "#1038 Fort Dodge, IA - Algona, IA",
39 : "#1039 Louisville, KY - Louisville, KY"
}
it is not the same as this question
{
"loads": {
"data": [
{
"id": 38,
"value": "#1038 Fort Dodge, IA - Algona, IA"
},
{
"id": 39,
"value": "#1039 Louisville, KY - Louisville, KY"
}
]
},
"date_ranges": {
"data": [
{
"id": "all_time",
"value": "All"
},
{
"id": "this_year",
"value": "This year"
}
]
}
}