molikto
02/12/2020, 2:43 PM@Composable fun Outer(i: Int, onClick: () -> Unit) {
@Composable fun Capturing() {
Text(i.toString())
}
Capturing()
Button(onClick = onClick) {
Text("me " + i)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Column {
var i by state { 0 }
Outer(i, {
i += 1
})
}
}
it seems nested functions can be defined but they are not working properly, Capturing
is considered not depending on any parameters, so it will not update when recomposeAdam Powell
02/12/2020, 2:45 PM