File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,21 @@ class EnumGenerator extends ProtobufContainer {
64
64
_aliases.add (EnumAlias (value, canonicalValue));
65
65
_originalAliasIndices.add (i);
66
66
}
67
+ // Generate Dart name for the enum value
68
+ String dartName;
69
+ final isProtobufEnumStyle =
70
+ parent.fileGen? .options.protobufEnumStyle ?? false ;
71
+ if (isProtobufEnumStyle) {
72
+ // Strip enum prefix from protobuf-style enum values
73
+ final strippedName = stripEnumPrefix (descriptor.name, value.name);
74
+ dartName = avoidInitialUnderscore (strippedName);
75
+ } else {
76
+ // Use original style
77
+ dartName = avoidInitialUnderscore (value.name);
78
+ }
79
+
67
80
dartNames[value.name] = disambiguateName (
68
- avoidInitialUnderscore (value.name) ,
81
+ dartName ,
69
82
usedNames,
70
83
enumSuffixes (),
71
84
);
You can’t perform that action at this time.
0 commit comments