evaluate method

MapEntry<String, dynamic> evaluate({
  1. dynamic onError(
    1. Object e,
    2. StackTrace s
    )?,
})

Evalutes the tree from this node and returns the result

Supply an onError function to be called when an error occures inside the evaluation

Implementation

MapEntry<String, dynamic> evaluate({
  Function(Object e, StackTrace s)? onError,
}) {
  try {
    Map<String, Map<String, dynamic>> nodeInputValues = {};
    _traverseInputNodes(nodeInputValues, this);

    return MapEntry(title, nodeInputValues[id]!.values.first);
  } catch (e, s) {
    onError?.call(e, s);
  }
  return MapEntry(title, null);
}