Remo
03/21/2022, 3:22 PMonClick
). Although, getting the compiler error @Composable invocations can only happen from the context of a @Composable function
since onClick
does not seem to accept a Composable
function as argument. What would I need to change in my code to get this work?
Code:
@Composable
private fun showDialogButton(){
Button(onClick = {openDialog()}){
Text("Hello Button")
}
}
@Composable
private fun openDialog(){
Dialog(onCloseRequest = {}, title = "Dialog"){
Button(onClick = {}) {
Text("Close Dialog")
}
}
}
mikehearn
03/21/2022, 3:30 PMRemo
03/21/2022, 3:35 PMZach Klippenstein (he/him) [MOD]
03/22/2022, 3:48 PMZach Klippenstein (he/him) [MOD]
03/22/2022, 3:50 PMKebbin
03/23/2022, 11:06 AMmikehearn
03/23/2022, 11:20 AMmikehearn
03/23/2022, 11:29 AMKebbin
03/24/2022, 12:14 AMmikehearn
03/24/2022, 2:17 PM