void writeNode(String label, TreeNode? node) { write('$label: '); depth += 1; if (node != null) { node.visit(printer!); } else { writeln('null'); } depth -= 1; }