operator []= method

void operator []=(
  1. String name,
  2. Object value
)

Set a config, attribute, or child on this node.

Implementation

operator []=(String name, Object value) {
  if (name.startsWith(r'$')) {
    configs[name] = value;
  } else if (name.startsWith(r'@')) {
    attributes[name] = value;
  } else if (value is Node) {
    addChild(name, value);
  }
}