getTypeName function

String getTypeName(
  1. DartType type
)

Implementation

String getTypeName(DartType type) {
  String display = type.getDisplayString(withNullability: true);
  if (display != "InvalidType") return display;

  return type.element?.name ?? type.element?.displayName ?? 'InvalidType';
}