generate static method

void generate(
  1. IndentingWriter out,
  2. String classname,
  3. List<ProtobufField> fields
)

Implementation

static void generate(
    IndentingWriter out, String classname, List<ProtobufField> fields) {
  out.addBlock('enum $classname {', '}\n', () {
    for (final field in fields) {
      final name = oneofEnumMemberName(field.memberNames!.fieldName);
      out.println('$name, ');
    }
    out.println('notSet');
  });
}