Created
December 4, 2021 09:23
-
-
Save takahirom/c4fb25c5c1df5e66d28fb363c829ae71 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() { | |
var checked by remember { mutableStateOf(false) } | |
// In the scope of the Composable function, | |
// I'm changing the checked! | |
checked = !checked | |
Switch( | |
checked = checked, | |
onCheckedChange = { | |
checked = it | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment