Skip to content

Commit

Permalink
2.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlee-thong committed Mar 13, 2023
1 parent f5cf067 commit 0579870
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 138 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.5.0] - 13 March 2023

- add `json` field to class with zero field

## [2.4.0] - 27 February 2023

- add generate json as comment setting
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dart QuickType
### version: 2.4.0
### version: 2.5.0

A custom implemenation of JSON to Dart model class from [QuickType](https://github.com/quicktype/quicktype).

Expand Down
3 changes: 2 additions & 1 deletion dart-json.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
"test": "test",
"cat": 23.3
}
]
],
"value_emp_obj": {}
}
16 changes: 10 additions & 6 deletions dart-result/lib/filename.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class MyClass {
required this.valObj,
required this.valObjInObj,
required this.valArrObj,
required this.valueEmpObj,
});

@JsonKey(name: 'val_int')
Expand Down Expand Up @@ -59,7 +60,7 @@ class MyClass {
final List<dynamic>? valueArrEmpty;

@JsonKey(name: 'value_obj_empty')
final ValueObjEmpty? valueObjEmpty;
final Value? valueObjEmpty;

@JsonKey(name: 'val_arr_string')
final List<String>? valArrString;
Expand All @@ -73,13 +74,16 @@ class MyClass {
@JsonKey(name: 'val_arr_obj')
final List<ValArrObj>? valArrObj;

@JsonKey(name: 'value_emp_obj')
final Value? valueEmpObj;

factory MyClass.fromJson(Map<String, dynamic> json) => _$MyClassFromJson(json);

Map<String, dynamic> toJson() => _$MyClassToJson(this);

@override
String toString(){
return "$valInt, $valId, $myClassId, $id, $valBool, $valDate, $valString, $valNull, $valDouble, $valArrInt, $valArrNumber, $valueArrEmpty, $valueObjEmpty, $valArrString, $valObj, $valObjInObj, $valArrObj, ";
return "$valInt, $valId, $myClassId, $id, $valBool, $valDate, $valString, $valNull, $valDouble, $valArrInt, $valArrNumber, $valueArrEmpty, $valueObjEmpty, $valArrString, $valObj, $valObjInObj, $valArrObj, $valueEmpObj, ";
}
}

Expand Down Expand Up @@ -172,12 +176,12 @@ class Province {
}

@JsonSerializable()
class ValueObjEmpty {
ValueObjEmpty();
class Value {
Value({required this.json});

factory ValueObjEmpty.fromJson(Map<String, dynamic> json) => _$ValueObjEmptyFromJson(json);
factory Value.fromJson(Map<String, dynamic> json) => _$ValueFromJson(json);

Map<String, dynamic> toJson() => _$ValueObjEmptyToJson(this);
Map<String, dynamic> toJson() => _$ValueToJson(this);

@override
String toString(){
Expand Down
2 changes: 1 addition & 1 deletion front-end/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="container py-5">
<div class="row h-100 align-items-center py-5">
<div class="col-lg-6">
<h1 class="display-4">Dart Quicktype 2.4.0</h1>
<h1 class="display-4">Dart Quicktype 2.5.0</h1>
<p class="lead text-muted mb-0">Generate a Dart class from JSON powered by QuickType</p>
<p class="lead text-muted">Maintainer: <a href="https://github.com/chunlee-thong"
target="_blank" class="text-muted">
Expand Down
2 changes: 1 addition & 1 deletion front-end/quicktype.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0579870

Please sign in to comment.