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 17 forks source link

Add equatable support for better equality checks #4

Closed ElZombieIsra closed 4 years ago

ElZombieIsra commented 4 years ago

Hi.

First of all, I love your extension. It's something that I see myself using all the time. Great work.

Second. This PR adds the ability to have better equality checks in the generated Dart models using the Equatable package. This is very important (for me, at least) because Dart works in magical and mysterious ways and is a little dumb to know when

Good() == Bad()

(is always false unless they are the same Instance). But that can be solved with equatable (and this PR).

Third. I've modified some things to make the code more readable and maintainable. I want to contribute to this extension and have an idea of how make the code even more readable and maintainable but I'd like to chat with you because it's a very heavy refactorization.

Four and last. I've changed some wording, styling and little things in the README.md to make it more styled. Hope you don't mind.

hiranthaR commented 4 years ago

@ElZombieIsra sure. Can you fix this conflicts :slightly_smiling_face:

ElZombieIsra commented 4 years ago

Sure. I'm on it

ElZombieIsra commented 4 years ago

Done