Created
December 4, 2021 08:46
-
-
Save takahirom/b01e859ccc1c0223e5a0b5513c4a4afb 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
@Composable | |
fun MySwitch() { | |
// MutableState | |
val checked = remember { mutableStateOf(false) } | |
// ****↓Add**** | |
println("MySwitch(): $checked") | |
// ****↑Add**** | |
Switch( | |
checked = checked.value, | |
onCheckedChange = { | |
checked.value = it | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment