Skip to content

Instantly share code, notes, and snippets.

@takahirom
Created December 4, 2021 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahirom/c4fb25c5c1df5e66d28fb363c829ae71 to your computer and use it in GitHub Desktop.
Save takahirom/c4fb25c5c1df5e66d28fb363c829ae71 to your computer and use it in GitHub Desktop.
@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