updateValue method

void updateValue(
  1. Expression expression
)

Clears the current value and sets it to the expression equivalent.

Implementation

void updateValue(Expression expression) {
  try {
    root = convertMathExpressionToTeXNode(expression);
  } catch (e) {
    throw Exception('Unsupported input expression $expression ($e)');
  }
  currentNode = root;
  currentNode.courserPosition = currentNode.children.length;
  currentNode.setCursor();
  notifyListeners();
}