Shakil Karim
08/28/2021, 3:23 PMtheapache64
08/28/2021, 3:36 PMSavedStateHandle
through the viewModel’s constructor and use SavedStateHandle#get<T>(yourKey)
to access the data.theapache64
08/28/2021, 3:36 PMhiltViewModel
methodFlorian
08/28/2021, 3:48 PMFlorian
08/28/2021, 3:48 PMShakil Karim
08/28/2021, 5:14 PMShakil Karim
08/28/2021, 5:24 PMtheapache64
08/28/2021, 5:34 PMnavController
. I was telling why don’t you mix it 😄 . Put a state
variable in viewModel, something like onNavigateToSplash = State<Boolean>
, observe it in the composable, and hoist the event from there? 🤔 it’d work, but doesn’t sound like a good approach 😄 isn’t it? 😬theapache64
08/28/2021, 5:35 PMFlorian
08/28/2021, 7:33 PMFlorian
08/28/2021, 7:33 PMShakil Karim
08/28/2021, 8:08 PMChannel
and collect in LaunchedEffect
but it would be much simpler if we can inject NavController in ViewModel and directly call navigate, I think it's is possible with NavController but we lose the state after process restart which rememberNavController do.Florian
08/28/2021, 8:11 PMIan Lake
08/29/2021, 12:38 AMShakil Karim
08/29/2021, 5:48 PMIan Lake
08/29/2021, 8:33 PMShakil Karim
08/29/2021, 9:05 PMIan Lake
08/29/2021, 9:51 PMShakil Karim
08/30/2021, 6:03 AMShakil Karim
08/30/2021, 6:10 AM