buildOr function

Expression<bool> buildOr(
  1. Iterable<Expression<bool>> iterable
)

This function takes an iterable of boolean expressions and builds an OR expression from them. If the iterable is empty, it returns a constant true expression. Otherwise, it reduces the iterable to a single expression using the | operator, and checks if the result equals true.

Implementation

Expression<bool> buildOr(Iterable<Expression<bool>> iterable) {
  if (iterable.isEmpty) return const Constant(true);
  final result = iterable.reduce((value, element) => value | element);

  return result.equals(true);
}