File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.5.1
2+
3+ * Fix copyProperty isEmpty case
4+
15## 1.5.0
26
37* add copyWith support
Original file line number Diff line number Diff line change @@ -458,6 +458,9 @@ class DartObject extends DartProperty {
458458 ]));
459459
460460 if (ConfigSetting ().addCopyMethod.value) {
461+ if (copyProperty.isEmpty) {
462+ copyProperty = item.name.value;
463+ }
461464 copyWithBodySb
462465 .writeLine ('${item .name }: ${item .name }?? $copyProperty ,' );
463466 copyWithParameterSb.writeLine (
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ class DartProperty extends Equatable {
245245 }
246246
247247 result =
248- " for (final dynamic item in ${DartHelper .jsonRes }['$key ']$nonNullable ) { if (item != null) { $addString }}" ;
248+ " for (final dynamic item in ${DartHelper .jsonRes }['$key ']$nonNullable as List<dynamic> ) { if (item != null) { $addString }}" ;
249249 } else {
250250 addString = 'items$count .add($item ); ' ;
251251
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ description: The tool to convert json to dart code.
1111# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212# Read more about iOS versioning at
1313# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14- version : 1.5.0
14+ version : 1.5.1
1515
1616environment :
1717 sdk : ' >=3.5.0 <4.0.0'
You can’t perform that action at this time.
0 commit comments