Closed VNAPNIC closed 4 years ago
Sorry pal, have no idea what are you talking about. "Cart"? show me the whole code if you want help.
Aha, Are you talking about Example.dart? Ok, then you've got me :)
I used your example, but when I run it and it error
https://github.com/k-paxian/dart-json-mapper/blob/master/example/example.dart
Just throw in these lines before deserialization:
// Because Person has a custom list List<Car>, we have to provide value cast decorator for it
// to be able to Deserialize
final iterableCarDecorator = (value) => value.cast<Car>();
JsonMapper.registerValueDecorator<List<Car>>(iterableCarDecorator);
// Serialize
print(JsonMapper.serialize(Person()));
// Deserialize
print(JsonMapper.deserialize<Person>(personJson));
Thanks for letting me know.
woo thank u, I think u should update the example
Absolutely! I'll do that thanks to your attention, documentation is going better.
I think if u remove the registerValueDecorator, well it great :)
// Deserialize
print(JsonMapper.deserialize<Person>(personJson));
print to: