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.
Dart to Json Model Generator creates your JSON object into separate files and thanks to this if similar structures are detected, generator will create them into different files and merge them with path (import) no matter how named your objects are. In this way you can keep your code cleaner and more readable. The path name in the first will be renamed with the class name added as a prefix to show from which class the objects are. If the names continue to be duplicated then will be marked with index for infinity renaming.
Before
Classes All, Home, Away have identical Goals class and all three class override the same class Goals.
After
As you can see in the picture, all three classes have their own generated class definitions and do not overwrite the same file.
How it works
Dart to Json Model Generator
creates yourJSON
object into separate files and thanks to this if similar structures are detected, generator will create them into different files and merge them with path (import) no matter how named your objects are. In this way you can keep your code cleaner and more readable. The path name in the first will be renamed with the class name added as a prefix to show from which class the objects are. If the names continue to be duplicated then will be marked with index for infinity renaming.Before
After