whenElse method

T whenElse(
  1. bool condition,
  2. T elseValue
)

Implementation

T whenElse(bool condition, T elseValue) {
  if (condition) {
    return this;
  }
  return elseValue;
}