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

Added new methods and bug fix. #10

Closed iamarnas closed 3 years ago

iamarnas commented 3 years ago

What's news...

@override int get hashCode => hashValues(userId, id, title, completed);

## Freezed 
Added `Freezed` support to create advanced classes with less boilerplate code. 
> This little and simple syntax in the example support all methods above and all what can generate this extension. In short "All in One".
 ```dart
  @freezed
  abstract class Todos with _$Todos {
      const factory Todos({
         int userId,
         int id,
         String title,
         bool completed,
      }) = _Todos;

      factory Todos.fromJson(Map<String, dynamic> json) => _$TodosFromJson(json);
  } 
hiranthaR commented 3 years ago

@iamarnas thank you very much :slightly_smiling_face:

iamarnas commented 3 years ago

@hiranthaR Np ;), hope you like it. I have a question. Are _generateClassDefinition(); from the model_generator.ts are main function which convert json file and provide result to file?