I was developing an App, where I manage diferents services offer by the users of the App.
So, I would like to create a secondary constructor, where I'm able to add the price to the service. Regarding what I reading on differents forums, the correctly way is to delegate into this() call the atributes of the primary Constructor, and the secondary constructor is in charge of the new atributes as price in my case.
So I try to do something like this:
@kotlinx.serialization.Serializable data class Service( var status: String?, var type: String, ) : Serializable { //TODO: Crear onstructor secundario para instanciar // los service mostrados en el publishFragment. constructor( status: String, type: String, price:Int) : this(status, type){ } } But I don't know how to set price without implements into the firts construtor.
I guess