when method
- bool predicate(
- T self
- T? orElse(
- T self
Returns the result of orElse
if predicate
returns false, otherwise
returns this.
Implementation
T? when(bool Function(T self) predicate, {T? Function(T self)? orElse}) =>
predicate(this) ? this : orElse?.call(this);