render method Null safety

void render(
  1. StringBuffer buffer
)

Renders this node into the given buffer.

Implementation

void render(StringBuffer buffer) {
  if (id != -1) {
    buffer.write(id);
  }
  if (isNotEmpty) {
    buffer.write('(');
    var addSpace = false;
    for (final child in children) {
      if (addSpace) {
        buffer.write(' ');
      }
      child.render(buffer);
      addSpace = true;
    }
    buffer.write(')');
  }
}