Comments (7)
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 :)
from dart-json-mapper.
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.
from dart-json-mapper.
Absolutely! I'll do that thanks to your attention, documentation is going better.
from dart-json-mapper.
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
from dart-json-mapper.
woo thank u, I think u should update the example
from dart-json-mapper.
I think if u remove the registerValueDecorator, well it great :)
from dart-json-mapper.
I would love to get rid of it myself,
here is the explanation of why it is like that. Dart language is not allowing another workaround for this case.
from dart-json-mapper.
Related Issues (20)
- Flutter Json Mapper (json_mapper) is failing to deserialize Enum HOT 1
- Cannot deserialize to a class with a constructor that takes an enum HOT 4
- Can't add sources to `build.yaml` using `flutter_translate_annotations` package HOT 7
- ignoreNullMembers seems to break the deserialization HOT 2
- Problem converting enum with following uppercase character HOT 9
- Adapter for https://pub.dev/packages/fast_immutable_collections
- `main.mapper.g.dart` is not generating all `@jsonSerializable` classes HOT 6
- `JsonMapper.copyWith` doesn't respect deep merge
- Parsing error when building for web HOT 9
- Improve class instance creation error handling HOT 4
- Problem converting enum with following uppercase character - second edition :) HOT 10
- Omit serializing optional fields HOT 14
- Issues with deserialising Color HOT 3
- Dart Json Mapper looks like don't generate valueDecorators when models in different package HOT 1
- Default discriminatorValue may not work. HOT 4
- Using with Retrofit HOT 2
- Serialize generic type. HOT 1
- @Json takes no effect even if put on top class & processAnnotatedMembersOnly in option will ignore all members when serialization HOT 1
- Empty Reflectable file - regarding HOT 1
- dart_json_mapper 2.2.10 depends on analyzer ^5.4.0 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-json-mapper.