getTypeName function
Gets the simple name of a type (without library prefix)
Implementation
String getTypeName(Type type) {
final typeString = type.toString();
final lastDot = typeString.lastIndexOf('.');
return lastDot != -1 ? typeString.substring(lastDot + 1) : typeString;
}