messageOrEnumClassName function
Chooses the name of the Dart class to generate for a proto message or enum.
For a nested message or enum, parent
should be provided
with the name of the Dart class for the immediate parent.
Implementation
String messageOrEnumClassName(
String descriptorName,
Set<String> usedNames, {
String parent = '',
}) {
if (parent != '') {
descriptorName = '${parent}_$descriptorName';
}
return disambiguateName(
avoidInitialUnderscore(descriptorName),
usedNames,
defaultSuffixes(),
);
}