takeUnless method

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

Returns this value if it does not satisfy the given predicate or null, if it does.

Implementation

@pragma('vm:prefer-inline')
@pragma('dart2js:tryInline')
T? takeUnless(bool Function(T) predicate) {
  if (!predicate(this as T)) return this as T;
  return null;
}