State-dependent composable

Report a typo

Take a look at the code below and determine which composable is state-dependent.

val hasMoney = mutableStateOf(false)

@Composable
fun MoneyScreen() {
    Surface {
        Column {
            Text("Do you have enough money?")

            if (hasMoney.value == false) {
                Text("No money, no honey!")
            }

            Button(onClick = { hasMoney.value = !hasMoney.value }) {
                Text("Check")
            }
        }
    }
}
Select one option from the list
___

Create a free account to access the full topic