File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
templates/flutter/lib/src/models Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,19 @@ class {{ definition.name | caseUcfirst }} {
3939{% endif %}
4040 };
4141 }
42-
4342{% if definition .additionalProperties %}
43+
4444 T convertTo<T >(T Function(Map) fromJson) => fromJson(data);
4545{% endif %}
46- {% if definition .name == ' documentList' %}
46+ {% for property in definition .properties %}
47+ {% if property .sub_schema %}
48+ {% for def in spec .definitions %}
49+ {% if def .name == property .sub_schema and def .additionalProperties and property .type == ' array' %}
50+
4751 List<T > convertTo<T >(T Function(Map) fromJson) =>
48- documents .map((d) => d.convertTo<T >(fromJson)).toList();
52+ {{ property . name }} .map((d) => d.convertTo<T >(fromJson)).toList();
4953{% endif %}
54+ {% endfor %}
55+ {% endif %}
56+ {% endfor %}
5057}
You can’t perform that action at this time.
0 commit comments