Hi everyone, I tried to use the id("kotlin-parceli...
# compose-desktop
a
Hi everyone, I tried to use the id("kotlin-parcelize") but doesnt work. The log says Plugin [id: 'kotlin-parcelize'] was not found in any of the following sources: Any idea how to solve it?
a
Parcelable
is Android-only. There's no such thing on desktop.
☝️ 2
a
I want to use @parcelize
Not Parceable
e
@Parcelize
writes a
Parcelable
implementation. it will not work on desktop.
c
What are you looking to do? KotlinX Serialization's
@Serializable
might fill the gap.
a
Im using Decompose for navigation. Im trying to do this;
a
You don't need to make it a
Parcelable
as
rememberSavable
doesn't actually save anything on desktop (because there's no configuration changes or restoration from process death). You can pass any type to
rememberSavable
on desktop.
If this is a MPP I think you need to use expect/actual mechanism.
a
Do you have any example about that? Yes, it's an MPP and I'm not sure how to start with the navigation. I only read about decompose
a
A quick search indicates that Decompose has already defined expect/actual classes of
Parcelable
 and 
@Parcelize
so that you can use them in your common module and you just need to apply
kotlin-parcelize
on your android module. See the official example.
a
Decompose usese Essenty library which provides Parcelable and Parcelize for KMP. Checkout the docs: https://arkivanov.github.io/Decompose/router/overview/#configurations-are-parcelable
102 Views