takeUnless method

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

Return the current value if the given block is not satisfied, will return null if it is.

Implementation

T? takeUnless(bool Function(T it) block) {
  if (this != null && !block(this!)) {
    return this;
  }
  return null;
}