child method Null safety

Node? child(
  1. String name
)

Returns a child Node with name.

If a child with name already exists and was not deleted, this method returns it. Otherwise, it creates a new Node.

Implementation

Node? child(String name) {
  if (_writer == null) {
    return Node.deleted();
  }
  if (_children.containsKey(name)) {
    return _children[name];
  }
  return _children[name] = Node._(this, name, index, _writer!);
}