Avatar ·

How to conveniently create Parcelable data classes in Android using Kotlin?

Hi everyone! I'm new to Kotlin and Android development. I have a simple data model that needs to be passed between Activities via Intent. Previously in Java I used Serializable, but I've heard that in Android it's better to use Parcelable for performance. The problem is that implementing Parcelable manually is just a nightmare: you need to write a bunch of boilerplate code with writeToParcel(), CREATOR, etc. Here's an example of my data class in Kotlin: ```kotlin data class User( val name: String, val age: Int, val email: String?, val isActive: Boolean ) ``` I want to make it Parcelable, but I don't want to write all these methods manually. I tried adding the Parcelable interface, but the IDE complains that I need to implement all the methods. Maybe there's some plugin or library that can auto-generate them?