I am having some problems with implementing Parcelable in a class in my app. This is written in Kotlin. I have a class called CocktailRecipe that has what you'd expect - name, description etc. It also has a two lists and a map. Ingredient and Equipment are also custom classes. I cannot figure out how to parcelise these - all the information I have found relates to Java, such as using parcelreadValue(this.getClass().getClassLoader())
but I cannot find the Kotlin equivalent of this. I also get a bunch of TODO comments generated in the parcel's constructor and I haven't been able to find any information on what should go in their place. Here is the beginning of the class - can anyone point me in the right direction?
TIA.
class CocktailRecipe(
recipeName: String?,
recipeImage: Int,
recipeBlurb: String?,
recipeDesc: String?,
recipEquipment: MutableList<Equipment>,
recipeIngredients: MutableMap<Ingredient, Int>,
recipeInstructions: MutableList<String>
) {
var name = recipeName
var image = recipeImage
var blurb = recipeBlurb
var description = recipeDesc
var equipment = recipEquipment
var ingredients = recipeIngredients
var instructions = recipeInstructions
var isFavourite = false
var rating = 0
// methods etc.
}