coalesce<T> function Null safety

Expression<T> coalesce<T>(
  1. List<Expression<T?>> expressions
)

Evaluates to the first expression in expressions that's not null, or null if all expressions evaluate to null.

Implementation

Expression<T> coalesce<T>(List<Expression<T?>> expressions) {
  assert(expressions.length >= 2,
      'coalesce must have at least 2 arguments, got ${expressions.length}');

  return FunctionCallExpression<T>('COALESCE', expressions);
}