Json to Dart Model extension can convert JSON objects into Dart data classes. It supports pure Dart class conversion, Flutter-recommended JSON serialization using annotations, Freezed support, Effective Dart:Style, and many more features. Currently, it has more than 135,000 installs.
It is possible to mark JSON values as default or required. Everything that do you need to do, just add to your JSON key d@ or r@ and Json to Dart Model will generate them for you. More...
d@ - Marks as default value.
r@ - Marks as required value.
{
"r@id": 1,
"d@title": "Json To Dart Model"
}
Result
class Example {
int id;
String title;
Example({@required this.id, this.title = 'Json To Dart Model'});
}
It is possible to mark
JSON
values as default or required. Everything that do you need to do, just add to yourJSON
keyd@
orr@
and Json to Dart Model will generate them for you. More...d@
- Marks as default value.r@
- Marks as required value.Result