attach method

void attach(
  1. dynamic input, {
  2. String? name,
})

Add this node to the given node. If input is a String, it is interpreted as a node path and resolved to a node. If input is a SimpleNode, it will be attached to that.

Implementation

void attach(dynamic input, {String? name}) {
  name ??= this.name;

  if (input is String) {
    provider.getNode(input)?.addChild(name, this);
  } else if (input is SimpleNode) {
    input.addChild(name, this);
  } else {
    throw 'Invalid Input';
  }
}