hiranthaR / Json-to-Dart-Model

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.
https://marketplace.visualstudio.com/items?itemName=hirantha.json-to-dart
MIT License
93 stars 18 forks source link

Fix code generated custom toJson function #2

Closed ElZombieIsra closed 4 years ago

ElZombieIsra commented 4 years ago

When generating code with JsonSerializable, the generated toJson function is custom made and doesn't use the JsonSerializable.toJson generated function.

This PR solves this and also introduces some styling to those functions.

Also appends --delete-conflicting-outputs to the flutter pub run build_runner build command in the terminal so it can always be built