fixFieldName function
Implementation
String fixFieldName(String name,
{required TypeDefinition typeDef, bool privateField = false}) {
var properName = name;
if (name.startsWith('_') || name.startsWith(new RegExp(r'[0-9]'))) {
final firstCharType = typeDef.name.substring(0, 1).toLowerCase();
properName = '$firstCharType$name';
}
final fieldName = camelCaseFirstLower(properName);
if (privateField) {
return '_$fieldName';
}
return fieldName;
}