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