remember Toggleable State
Util function that creates a remembered value and that has a function to toggle the boolean state, thus avoiding doing:
var state by remember { mutableStateOf(false) }
// ...
state = state.not()
// ...
state = state.not()
// ...
state = state.not()
Content copied to clipboard