Closed matheuscuba closed 4 years ago
Hi, I believe you should define in the mapping
function like this:
class TheList {
List<MyModel> items;
void mapping(Mapper map) {
map<MyModel>("items", items, (v) => items = v);
}
}
Hi, I believe you should define in the
mapping
function like this:class TheList { List<MyModel> items; void mapping(Mapper map) { map<MyModel>("items", items, (v) => items = v); } }
Thanks, but didn't work. I ended up using a workaround, by changing the api to return the list in a property like this:
{
list: [ ]
}
so the library can map my model.
I will be closing the issue
When I try to convert a json list into
List<MyModel>
its throw a error:How can I convert a json like this?