whenn method

T? whenn(
  1. bool predicate(
    1. T self
    )
)

Special case when "there is no else", avoiding the curried invocation.

Implementation

T? whenn(bool Function(T self) predicate) => predicate(this) ? this : null;