Many crossplatform tools like Xamarin and React Na...
# multiplatform
m
Many crossplatform tools like Xamarin and React Native have some way of dealing with navigation (going from one screen to another) from the shared/common code - usually by providing a NavigationService either included by the framework or from libraries. Anyone knows about a thing like that for kotlin-multiplatform?
s
my team just made our own. It wasn’t super difficult, but then things get complicated really quick if you want to maintain view state when you go back. Something to think about before you roll your own.
m
Indeed, it appears easy enough at first but there are many edge cases. And you probably need support for different types of navigation, full screen overtakes, modal views, dialogs... perhaps a burger-menu thingie. Passing objects back and forth between screens
If i have to make my own im probably gonna steal one from Xamarin, C# is similar enough to kotlin that it should be doable. But its still gonna take a while to do i think
I dont suppose the one you made is open source @spierce7? 🙂
s
It’s not. We’re also unhappy with it currently, and are going to try to make it compatible with the new Android navigation framework (we think). Androids navigation library was a joke at first, but it’s getting more and more serious/beneficial it seems.
We’re also interested in making it work with compose. These Ice Rock guys have lots of support for multiplaform library. Their libraries go deep… even so far as to a shared View library (I recommend you stay away from that) https://github.com/icerockdev
m
Yeah i found moko-mvvm which looks nice but was a little surprised that it didnt have a navigation service