2023-06-22 20:00:07 +02:00
|
|
|
--- native_class.mustache 2023-06-22 12:56:11.090350406 -0500
|
|
|
|
+++ native_class1.mustache 2023-06-22 12:57:14.498184792 -0500
|
2023-01-10 05:08:45 +01:00
|
|
|
@@ -91,14 +91,14 @@
|
|
|
|
{{/isDateTime}}
|
|
|
|
{{#isNullable}}
|
|
|
|
} else {
|
|
|
|
- json[r'{{{baseName}}}'] = null;
|
2023-06-22 20:00:07 +02:00
|
|
|
+ // json[r'{{{baseName}}}'] = null;
|
2023-01-10 05:08:45 +01:00
|
|
|
}
|
|
|
|
{{/isNullable}}
|
|
|
|
{{^isNullable}}
|
|
|
|
{{^required}}
|
|
|
|
{{^defaultValue}}
|
|
|
|
} else {
|
|
|
|
- json[r'{{{baseName}}}'] = null;
|
2023-06-22 20:00:07 +02:00
|
|
|
+ // json[r'{{{baseName}}}'] = null;
|
2023-01-10 05:08:45 +01:00
|
|
|
}
|
|
|
|
{{/defaultValue}}
|
|
|
|
{{/required}}
|
2023-06-22 20:00:07 +02:00
|
|
|
@@ -114,17 +114,6 @@
|
|
|
|
if (value is Map) {
|
|
|
|
final json = value.cast<String, dynamic>();
|
|
|
|
|
|
|
|
- // Ensure that the map contains the required keys.
|
|
|
|
- // Note 1: the values aren't checked for validity beyond being non-null.
|
|
|
|
- // Note 2: this code is stripped in release mode!
|
|
|
|
- assert(() {
|
|
|
|
- requiredKeys.forEach((key) {
|
|
|
|
- assert(json.containsKey(key), 'Required key "{{{classname}}}[$key]" is missing from JSON.');
|
2023-06-22 19:48:57 +02:00
|
|
|
- assert(json[key] != null, 'Required key "{{{classname}}}[$key]" has a null value in JSON.');
|
2023-06-22 20:00:07 +02:00
|
|
|
- });
|
|
|
|
- return true;
|
|
|
|
- }());
|
|
|
|
-
|
|
|
|
return {{{classname}}}(
|
|
|
|
{{#vars}}
|
|
|
|
{{#isDateTime}}
|