Created
December 4, 2021 09:31
-
-
Save takahirom/32990fc34503741f5b9826feb71014e8 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 Screen() { | |
var checked by remember { mutableStateOf(false) } | |
MySwitch(checked = checked, onCheckChanged = { checked = it }) | |
} | |
@Composable | |
fun MySwitch(checked: Boolean, onCheckChanged: (Boolean) -> Unit) { | |
Switch( | |
checked = checked, | |
onCheckedChange = { | |
onCheckChanged(it) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment