Using the official Navigation library from Google&...
# compose
d
Using the official Navigation library from Google&Jetbrains for Compose Multiplatform: 1. How to preserve last screen after the app lost it's focus ? (Another app was opened) 2. How to preserve the screen even after the app was closed and reopened (let's say you did the login, close the app, open again, expect the login screen is skipped, and/or open last screen) (I'm a backend developer who does mobile as a hobby, I don't know the exact terminology sometimes*)
s
You’d need to store the state of the app (logged out / logged in), then on launch read it and show the correct screen
d
@Sergey Dmitriev 1. Using compose native solutions/ Navigation lib API (I remember there was something like rememberSaveable()) 2. Using other methods like MultiplatformSettings library etc ?
s
it’s option 2 since you need to write it on disk using DataStore for example
d
DataStore for KMP is better than Multiplatform Settings lib ?
s
I’ve never used Multiplatform Settings lib so I can’t tell DataStore is developed by google so it’s definitely a plus, but pick whatever fits you best!
d
I did not use neither of them, but chat gpt suggests the MS is simpler for KMP For cross-platform consistency and simplicity, Multiplatform Settings remains a solid choice, though DataStore offers the advantage of reactive flows and alignment with Jetpack trends. Anyway thank you for DataStore option, did not know about it
🙌 1