getTypeName function

String getTypeName(
  1. Type type
)

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;
}