when method

When when(
  1. Expr predicate
)

Starts a conditional when(...).then(...).otherwise(...) expression whose first branch applies where predicate is true.

Implementation

When when(Expr predicate) {
  _requireExpr(predicate);
  return When._(this, predicate);
}