isNumericalExpression property

bool isNumericalExpression

Determines whether this string represents a valid numerical expression such as:

  • "3.8 / 2"
  • "cos(pi) - 18 * 6"

The x variable is not valid because this getter only considers numerical values.

Implementation

bool get isNumericalExpression =>
    !contains('x') && ExpressionParser._parser.accept(this);