We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1db0162 commit 355ba2aCopy full SHA for 355ba2a
lib/src/common/functional_extender.dart
@@ -25,7 +25,13 @@ extension FunctionalExtender<T> on T? {
25
T? takeIf(bool Function(T) f) {
26
final T? self = this;
27
28
- return self != null && f(self) ? self : null;
+ if (self == null) return null;
29
+
30
+ if (f(self)) {
31
+ return self;
32
+ } else {
33
+ return null;
34
+ }
35
}
36
37
0 commit comments