isValid property

bool get isValid

Checks if the current operation is valid.

Implementation

bool get isValid {
  return operands.isNotEmpty &&
      operands.length == 2 &&
      operands.every((operand) => isStringNumber(operand)) &&
      (operator == null || operator!.isNotEmpty);
}