xor method

Predicate<T> xor(
  1. Predicate<T> predicate
)

Compose this Predicate with the given predicate using XOR.

You can also use the ^ operator.

Implementation

Predicate<T> xor(Predicate<T> predicate) => Predicate((t) {
      final boolThis = _predicate(t);
      final boolOther = predicate(t);
      return boolThis ? !boolOther : boolOther;
    });