Sudhir Singh Khanger
03/06/2021, 8:42 AMMaterialTheme.colors.onSurface
in a Composable. Cursor hover tells me
org.jetbrains.kotlin.diagnostics.SimpleDiagnostic@9406416a (error: could not render message)
whereas the build window tells me @Composable invocations can only happen from the context of a @Composable function
But I am using it inside a Composable function.Filip Wiesner
03/06/2021, 9:31 AMremember {}
but I can't help you without seeing your code.Sudhir Singh Khanger
03/07/2021, 5:28 AM@Composable
fun Test() {
MyTheme {
Column {
Canvas(modifier = Modifier.fillMaxSize()) {
drawCircle(
color = MaterialTheme.colors.onSurface,
radius = 10f
)
}
}
}
}
tad
03/08/2021, 2:25 AMDrawScope.()
closure. You need to set a variable before the call to Canvas
to use it in the closure.Sudhir Singh Khanger
03/08/2021, 4:16 AM