Closed amoh-godwin closed 11 months ago
I have gotten it fixed.
The problem was, I was doing
gameViewModel: GameViewModel = GameviewModel()
instead of
gameViewModel: GameViewModel = viewModel()
because the imports was showing an error. And the import was showing an error because
I didn't have
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
as part of the build.gradle.kts module version file.
Now I have the dependency and so I have the correct code and so now it works
When following the lesson on Viewmodel and State. The scrambled word keeps changing after I press inside the outlinedText and try to change the text. I decided to log the
init
and reliased that theinit
function gets called repeatedly. How do I stop it?