KMPParcelize
2.0.0indexedEnables parcelable support across multiple platforms, facilitating seamless data serialization and deserialization. Offers custom annotation processing and supports complex data structures for efficient data transfer.
Enables parcelable support across multiple platforms, facilitating seamless data serialization and deserialization. Offers custom annotation processing and supports complex data structures for efficient data transfer.
This library provides parcelize annotations that can be used inside commonMain source sets.
Following is provided inside the com.michaelflisar.parcelize package:
package com.michaelflisar.parcelize
expect interface Parcelable
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
()
()
The actual implementations for android looks as following:
package com.michaelflisar.parcelize
actual typealias Parcelable = android.os.Parcelable
actual typealias Parcelize = kotlinx.parcelize.Parcelize
actual typealias IgnoredOnParcel = kotlinx.parcelize.IgnoredOnParcel
actual typealias RawValue = kotlinx.parcelize.RawValue
| Module | android | iOS | windows |
|---|
| Dependency | Version |
|---|---|
| Kotlin | 2.4.0 |
| Jetbrains Compose | 1.11.1 |
Define the dependencies inside your libs.versions.toml file.
Simply add the dependencies inside your build.gradle.kts file.
val kmpparcelize = "<LATEST-VERSION>"
implementation("io.github.mflisar.kmpparcelize:library:${kmpparcelize}")
Simple use the provided annotations instead of the one from androidx and you are done.
Check out the API documentation.
You can find more libraries (all multiplatform) of mine that all do work together nicely here.
| macOS |
|---|
| wasm |
|---|
| Notes |
|---|
| library | ✅ | ✅ | ✅ | ✅ | ✅ | This provides parcelize classes and annotations compatible with kmp multiplatform |
[versions]
kmpparcelize = "<LATEST-VERSION>"
[libraries]
kmpparcelize-library = { module = "io.github.mflisar.kmpparcelize:library", version.ref = "kmpparcelize" }
And then use the definitions in your projects build.gradle.kts file like following:
implementation(libs.kmpparcelize.library)
Surfaced from shared tags and platforms — no rankings paid for.