toDisplayString method Null safety

  1. @override
String toDisplayString()
override

Generate a display string for this expression.

Implementation

@override
String toDisplayString() {
  final buffer = StringBuffer('[');
  for (var i = 0; i < _list.length; i++) {
    buffer.write(_list[i].toDisplayString());
    if (i < _list.length - 1) {
      buffer.write(', ');
    }
  }
  buffer.write(']');
  return buffer.toString();
}