createPathName function
Returns the full class name with joined path.
Implementation
List<Name> createPathName(
List<Name> path,
NamingScheme? namingScheme, [
Name? currentClassName,
Name? currentFieldName,
Name? alias,
]) {
final fieldName = alias ?? currentFieldName;
final className = alias ?? currentClassName;
List<Name?> fullPath;
switch (namingScheme) {
case NamingScheme.simple:
fullPath = className == null
? (path.length == 2 ? path : [path.last])
: [className];
case NamingScheme.pathedWithFields:
fullPath = [...path, fieldName];
case NamingScheme.pathedWithTypes:
fullPath = [...path, className];
case null:
throw UnimplementedError();
}
return fullPath.whereType<Name>().toList();
}