Why doesn't this work:
var color: Int = 0xFF0000FF
and why do I have to call toInt()
var color: Int = 0xFF0000FF.toInt()
Why doesn't this work:
var color: Int = 0xFF0000FF
and why do I have to call toInt()
var color: Int = 0xFF0000FF.toInt()
This is a bug in the compiler, feel free to vote / watch it: https://youtrack.jetbrains.com/issue/KT-2780
I am using boolean an in my case I was using this way with same error
var shouldShowOnBoarding by remember { mutableStateOf(true) }
Previous import was
import androidx.compose.runtime.Composable
Then I changed it to
import androidx.compose.runtime.*
© 2022 - 2024 — McMap. All rights reserved.
0xFF0000FF
is not an integer already, so you have to convert it to an integer if you want yourcolor
variable to be that type. – Isabelleisac