writeEnum method
void
writeEnum(
- DartOptions generatorOptions,
- Root root,
- Indent indent,
- Enum anEnum, {
- required String dartPackageName,
override
Writes a single Enum to indent
. This is needed in most generators.
Implementation
@override
void writeEnum(
DartOptions generatorOptions,
Root root,
Indent indent,
Enum anEnum, {
required String dartPackageName,
}) {
indent.newln();
addDocumentationComments(
indent, anEnum.documentationComments, _docCommentSpec);
indent.write('enum ${anEnum.name} ');
indent.addScoped('{', '}', () {
for (final EnumMember member in anEnum.members) {
addDocumentationComments(
indent, member.documentationComments, _docCommentSpec);
indent.writeln('${member.name},');
}
});
}