typeParametersString function

String typeParametersString(
  1. Iterable<TypeParameter> typeParameters, {
  2. bool withBounds = false,
})

Implementation

String typeParametersString(
  Iterable<TypeParameter> typeParameters, {
  bool withBounds = false,
}) {
  final parameters =
      typeParameters.map((e) => withBounds ? e.toSource() : e.name).join(', ');

  if (parameters.isNotEmpty) {
    return '<$parameters>';
  } else {
    return '';
  }
}