evaluate method
Evaluats the conditional to return a bool based on the criteria and the
given values. The given values must be a Map or a Map-like object
that implements the []
operator or else an error will be thrown.
This will either evaluate based off of the values or the child
conditional
objects.
When operating in the EvaluationMode.and then all values must equal
the respective values inside of actual
, or all the child conditionals
must evaluate to true
. When operating in EvaluationMode.or then only
one of the values must exist in actual
or only one of the
conditionals
must evaluate to true
.
Implementation
bool evaluate(dynamic actual) => values == null
? _evaluateConditions(actual ?? {})
: _evaluateValues(actual ?? {});