Created
August 16, 2023 20:48
-
-
Save kakai248/1278edea56c0015d8940169890eb6c7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun Modifier.conditional( | |
condition: Boolean, | |
ifTrue: Modifier.() -> Modifier, | |
ifFalse: Modifier.() -> Modifier = { this }, | |
): Modifier = if (condition) { | |
then(ifTrue(this)) | |
} else { | |
then(ifFalse(this)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment