File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
templates/dart/lib/src/models Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,15 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model
32
32
{{property .sub_schema | caseUcfirst | overrideIdentifier }}.fromMap(map['{{property .name | escapeDollarSign }}'])
33
33
{%- endif -%}
34
34
{%- else -%}
35
- map['{{property .name | escapeDollarSign }}']
36
- {%- if property .type == " number" -%}
37
- {%- if not property .required %}?{% endif %}.toDouble()
38
- {%- endif -%}
39
- {%- if property .type == " string" -%}
40
- {%- if not property .required %}?{% endif %}.toString()
41
- {%- endif -%}
42
35
{%- if property .type == ' array' -%}
43
- {%- if property .sub_schema -%}
44
- List< {{property .sub_schema | caseUcfirst | overrideIdentifier }}>.from(map['{{property .name | escapeDollarSign }}'].map((p) => {{property .sub_schema | caseUcfirst | overrideIdentifier }}.fromMap(p)))
45
- {%- else -%}
46
- List< {{ property | typeNameInner }}>.from(map['{{property .name | escapeDollarSign }}']?.map((x) => x{% if property .items .type == " string" %}.toString(){% endif %}) ?? [])
36
+ List< {{ property .items .type | caseUcfirst }}>.from(map['{{property .name | escapeDollarSign }}']?.map((x) => x{% if property .items .type == " string" %}.toString(){% endif %}) ?? [])
37
+ {%- else -%}
38
+ map['{{property .name | escapeDollarSign }}']
39
+ {%- if property .type == " number" -%}
40
+ {%- if not property .required %}?{% endif %}.toDouble()
41
+ {%- endif -%}
42
+ {%- if property .type == " string" -%}
43
+ {%- if not property .required %}?{% endif %}.toString()
47
44
{%- endif -%}
48
45
{%- endif -%}
49
46
{%- endif -%},
@@ -79,4 +76,4 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model
79
76
{% endfor %}
80
77
{% endif %}
81
78
{% endfor %}
82
- }
79
+ }
You can’t perform that action at this time.
0 commit comments