diff --git a/android/build.gradle b/android/build.gradle index 8ad2194..fc0801d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,12 +28,22 @@ apply plugin: 'kotlin-android' android { compileSdkVersion 33 + if (project.android.hasProperty('namespace')) { + namespace 'io.alexrintt.sharedstorage' + } + + sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 19 } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } } dependencies { diff --git a/lib/src/common/functional_extender.dart b/lib/src/common/functional_extender.dart index 7e0bd65..c9abffc 100644 --- a/lib/src/common/functional_extender.dart +++ b/lib/src/common/functional_extender.dart @@ -25,7 +25,13 @@ extension FunctionalExtender on T? { T? takeIf(bool Function(T) f) { final T? self = this; - return self != null && f(self) ? self : null; + if (self == null) return null; + + if (f(self)) { + return self; + } else { + return null; + } } }