Flutter Dart deserialize a json with dynamic key but structured values into Map<String, ModelClass>
问题 Is it possible to deserialize a json with dynamic key but structured values into Map in flutter dart. I am having a json like { "data" : { "apple":{"qty":5, "price":100}, "orange":{"qty":2, "price":40}, } } And I want this to deserialize in flutter/dart to a model class below class Data { Map<String, Item> itemMap; factory Data.fromJson(Map<String,dynamic> json) { itemMap : json["data"]; //How to parse. } } class Item { int qty; int price; } I have read through a medium blog and even this