runCondition method

  1. @override
bool? runCondition(
  1. String expression,
  2. Map<String, Object?> value, {
  3. Map<String, Object?>? properties,
})
override

Implementation

@override
bool? runCondition(String expression, Map<String, Object?> value,
    {Map<String, Object?>? properties}) {
  final exp =
      '''surveyjs.runCondition("$expression","${escape(json.encode(value))}")''';
  final jsResult = jsRuntime!.evaluate(exp);
  if (jsResult.isError) {
    throw Exception(jsResult.rawResult);
  }
  return bool.tryParse(jsResult.stringResult);
}