Complete the code below to create a TriStateCheckbox with the following features:
It should initially be in the Indeterminate state.
The checkmark color should be white.
The background color when checked should be blue.
Complete the code below to create a TriStateCheckbox with the following features:
It should initially be in the Indeterminate state.
The checkmark color should be white.
The background color when checked should be blue.
@Composable
fun TriStateCheckboxExample() {
var state by remember { mutableStateOf(ToggleableState.) }
TriStateCheckbox(
state = state,
= {
state = when (state) {
ToggleableState.On -> ToggleableState.Off
ToggleableState.Off -> ToggleableState.Indeterminate
ToggleableState.Indeterminate -> ToggleableState.On
}
},
colors = .colors(
= Color.White,
= Color.Blue
)
)
}Create a free account to access the full topic