Greetings Everyone. I'm working on a KMP project targeting android and desktop.
My project structure is attached below.
I've developed 4 composable screens including one splash screen.
Now, what I want to do is that upon starting application splash screen should be displayed for a couple of seconds followed by screen A and then connect screens with each other i.e., upon a button click on a screen navigate to the next screen along with passing some data from one screen to another.
I looked over the internet and tried implementing
NavController
but it isn't working under common module.
How can I achieve this? Any help would be appreciated.
The NavController is only Android, you will need a navigation library. There are a couple with similar API to compose navigation,
precompose
is the one I remember. Different API but very advanced features is
decompose
and
voyager
. If you want something simple but need to handle the lifecycle state on your own use this one bellow: https://github.com/chRyNaN/navigation
If none of them fit your needs go to GitHub and search for one, there are a couple more that I might have missed.
Pablichjenkov
06/21/2023, 1:11 PM
But as the comment above said, making your own or working with one that you fully understand is key. Your navigation lib is something you want to have full knowledge of how internal works.