@@ -9,8 +9,10 @@ class Dart extends LanguageMeta {
99 case AttributeType.STRING:
1010 case AttributeType.EMAIL:
1111 case AttributeType.DATETIME:
12- case AttributeType.ENUM:
1312 type = "String";
13+ if (attribute.format === AttributeType.ENUM) {
14+ type = LanguageMeta.toPascalCase(attribute.key);
15+ }
1416 break;
1517 case AttributeType.INTEGER:
1618 type = "int";
@@ -23,7 +25,7 @@ class Dart extends LanguageMeta {
2325 break;
2426 case AttributeType.RELATIONSHIP:
2527 type = LanguageMeta.toPascalCase(attribute.relatedCollection);
26- if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') (attribute.relationType === 'manyToOne' && attribute.side === 'child') || || attribute.relationType === 'manyToMany') {
28+ if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
2729 type = `List< ${type}>`;
2830 }
2931 break;
@@ -44,6 +46,16 @@ class Dart extends LanguageMeta {
4446<% if (attribute.type === ' relationship' ) { -%>
4547import '<% - attribute.relatedCollection.toLowerCase() %> .dart';
4648
49+ <% } -%>
50+ <% } -%>
51+ <% for (const attribute of collection.attributes) { -%>
52+ <% if (attribute.format === ' enum' ) { -%>
53+ enum <% - toPascalCase(attribute.key) %> {
54+ <% for (const element of attribute.elements) { -%>
55+ <% - toPascalCase(element) %> ,
56+ <% } -%>
57+ }
58+
4759<% } -%>
4860<% } -%>
4961class <%= toPascalCase(collection.name) %> {
0 commit comments