MBegemot
11/22/2019, 10:40 AMYann Badoual
11/22/2019, 10:43 AMif
block,
ie:
val shouldShow = +state { true }
if (shouldShow) {
Button(...)
}
// To show or hide button:
state.value = true
state.value = false
Yann Badoual
11/22/2019, 10:43 AM@Model
annotated class instead of a state
@Model
class MyModel(
var shouldShowButton: Boolean = false
)
val model = +model { MyModel() }
if (model.shouldShowButton) {
Button(...)
}
model.shouldShowButton = false