Created
March 18, 2025 09:14
-
-
Save phdesign/675825973328afc49c190df7967a1346 to your computer and use it in GitHub Desktop.
Holding a reference to a composable in Kotlin
This file contains hidden or 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
val icon: @Composable () -> Unit = if (isMatch) { | |
{ | |
Icon( | |
imageVector = Icons.Outlined.CheckCircle, | |
contentDescription = "DNS location matches your IP", | |
) | |
} | |
} else { | |
{ | |
Icon( | |
imageVector = Icons.Outlined.ErrorOutline, | |
contentDescription = "DNS location does not match your IP", | |
) | |
} | |
} | |
... | |
{ icon() } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment