m

    Marko Novakovic

    1 year ago
    when using
    var state by remember { mutableStateOf(…) }
    I get error saying there are no
    get
    and
    set
    methods BUT I have
    import androidx.compose.runtime.getValue
    import androidx.compose.runtime.setValue
    and they are grey, not used. same
    get
    and
    set
    methods error when using
    import androidx.compose.runtime.*
    Any fix?
    c

    Cezar Olteanu

    1 year ago
    Usually I delete the remember import or the whole runtime inport and reinport them 1 by 1, but keep the get and set imports
    m

    Marko Novakovic

    1 year ago
    @Cezar Olteanu tried that, not working
    Filip Wiesner

    Filip Wiesner

    1 year ago
    In my experience it usually helps to define all the types and let AS import everything on its own witl Alt+Enter. So e.g.
    var state by remember<MutableState<Boolean>> { mutableStateOf(true) }
    m

    Marko Novakovic

    1 year ago
    @Filip Wiesner it worked 😄 thanks