takeUnless method

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

Returns this if it doesn't satisfy the given predicate or null, if it doesn't.

Implementation

T? takeUnless(bool Function(T obj) predicate) {
  if (!predicate(this)) {
    return this;
  }
  return null;
}