@@ -9,8 +9,10 @@ class Dart extends LanguageMeta {
9
9
case AttributeType.STRING:
10
10
case AttributeType.EMAIL:
11
11
case AttributeType.DATETIME:
12
- case AttributeType.ENUM:
13
12
type = "String";
13
+ if (attribute.format === AttributeType.ENUM) {
14
+ type = LanguageMeta.toPascalCase(attribute.key);
15
+ }
14
16
break;
15
17
case AttributeType.INTEGER:
16
18
type = "int";
@@ -23,7 +25,7 @@ class Dart extends LanguageMeta {
23
25
break;
24
26
case AttributeType.RELATIONSHIP:
25
27
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') {
27
29
type = `List< ${type}>`;
28
30
}
29
31
break;
@@ -44,6 +46,16 @@ class Dart extends LanguageMeta {
44
46
<% if (attribute.type === ' relationship' ) { -%>
45
47
import '<% - attribute.relatedCollection.toLowerCase() %> .dart';
46
48
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
+
47
59
<% } -%>
48
60
<% } -%>
49
61
class <%= toPascalCase(collection.name) %> {
0 commit comments