or static method

Expression<bool> or(
  1. Iterable<Expression<bool>> predicates, {
  2. Expression<bool> ifEmpty = const Literal(false),
})

Chains all predicates together into a single expression that will evaluate to true iff any of the predicates evaluates to true.

The ifEmpty value will be used when no predicates have been passed to or. By default, false is returned.

Implementation

static Expression<bool> or(
  Iterable<Expression<bool>> predicates, {
  Expression<bool> ifEmpty = const Literal(false),
}) {
  if (predicates.isEmpty) {
    return ifEmpty;
  }

  return predicates.reduce((value, element) => value | element);
}