typeToString function

String typeToString (DartType type)

Compute a String representation of a type.

Implementation

String typeToString(DartType type) {
  if (type is InterfaceType) {
    if (type.typeArguments.isEmpty) return type.name;
    return type.name +
        '<' +
        type.typeArguments.map(typeToString).join(', ') +
        '>';
  } else {
    return type.name;
  }
}