addInput method
Add a node
to the inputs if it has not been added yet.
- Resolves
nodeValue
to a Node using graph. - Returns
true
if it was added without duplication. - Throws a StateError if graph is
null
when trying to resolvenodeValue
to a Node.
Implementation
@override
Node<T>? addInput(T nodeValue) {
if (nodeValue == value) return null;
if (!containsInput(nodeValue)) {
var node = _resolveNode(nodeValue);
return _addInputNode(node);
}
return null;
}