error "_TypeError (type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>')" Using the json_serializable: ^2.0.0 library.

Looking for some help with the following error "_TypeError (type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>')" Using the json_serializable: ^2.0.0 library.
When I call the fromJson method and my json object has a nested object list is when the error is throw.
You already invited:

Dmitry

Upvotes from:

I guess you defined the list of type List<Map<String,dynamic>>. If so, the deserialized map from json is of type Map<dynamic, dynamic> and you have to cast each map before assigning to that list

If you wanna answer this question please Login or Register