takeIf method
T?
takeIf(
- bool block(
- T it
Return the current value if the given block is satisifed, will return
null
if not.
Implementation
T? takeIf(bool Function(T it) block) {
if (this != null && block(this!)) {
return this;
}
return null;
}