How do I exclude a property in a data class from being Parcelized?
@Parcelize
data class State(
val userId: String = 1234,
val userResource: Resource<User> = Resource.Uninitialized
): Parcelable
I want to exclude the
userResource
property from being Parcelized, as the
Resource
class is not Parcelable.
Here is the warning I get from the IDE:
Type is not directly supported by @Parcelize. Annotate the field with @RawValue if you want to be serialized using 'writeValue()'
@Transient
does not work, and neither does
@IgnoreOnParcel
(I get the warning that it is not applicable on properties in primary constructor). Any way to solve this?