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