getTypeName function
Implementation
String getTypeName(DartType type) {
String display = type.getDisplayString(withNullability: true);
if (display != "InvalidType") return display;
return type.element?.name ?? type.element?.displayName ?? 'InvalidType';
}