toCode method Null safety

String toCode()

Implementation

String toCode() {
  var type = StringBuffer(name);
  if (typeArguments.isNotEmpty) {
    type.write('<');
    var types = [];
    for (var typeArg in typeArguments) {
      types.add(typeArg.toCode());
    }
    type.write(types.join(', '));
    type.write('>');
  }
  if (isNullable) type.write('?');
  return type.toString();
}