File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
templates/dart/lib/src/models Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,16 @@ 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
- {%- if property .type == " array" -%}
43
- {% if property .required %} ?? []{% endif %}
35
+ {%- if property .type == ' array' -%}
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()
44
+ {%- endif -%}
44
45
{%- endif -%}
45
46
{%- endif -%},
46
47
{% endfor %}
@@ -75,4 +76,4 @@ class {{ definition.name | caseUcfirst | overrideIdentifier }} implements Model
75
76
{% endfor %}
76
77
{% endif %}
77
78
{% endfor %}
78
- }
79
+ }
You can’t perform that action at this time.
0 commit comments