--

Hi, thanks for your compliments.

In the View system, the way I would implement this is to have a Navigator module that knows how to navigate to the different screens in your app. When the user taps a button that should take them to a new screen, this would trigger an Intent that the viewmodel will handle and then call navigate in the navigator, with the destination the user should be taken to.

In compose you can pass a lambda to your composable that will be called when the user taps on the button, which will in turn navigate to your destination.

State should be used to represent your UI, navigation is not state so it should not be represented in the state class.

--

--

Francesc Vilarino Guell
Francesc Vilarino Guell

No responses yet