evaluateOperation function

bool evaluateOperation(
  1. dynamic a,
  2. dynamic b, {
  3. dynamic comparator,
  4. dynamic operation = isEqual,
})

Implementation

bool evaluateOperation(a, b, {comparator, operation = isEqual}) {
  if (comparator != null) {
    if (comparator is Function) {
      return operation(comparator(a), comparator(b));
    }
    if (a is Map && comparator is String) {
      return operation(a[comparator], b[comparator]);
    }
  }
  return operation(a, b);
}