takeIf method
Implementation
@pragma('vm:prefer-inline')
T? takeIf(bool Function(T) predicate) {
if (predicate(this)) return this;
return null;
}
@pragma('vm:prefer-inline')
T? takeIf(bool Function(T) predicate) {
if (predicate(this)) return this;
return null;
}