takeUnless method

T? takeUnless(
  1. bool predicate(
    1. T it
    )
)

Returns this if it does NOT satisfy predicate, otherwise null.

The inverse of takeIf.

Implementation

T? takeUnless(bool Function(T it) predicate) =>
    !predicate(this) ? this : null;