I want to use safeArgs to send an object from a fragment to another one but Parcelable is not working even with me adding the necessary plugin. Can somebody please help me? the model class
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
@Parcelize
data class GazModel(
val id: String,
val name: String,
val description: String?,
val price : Double,
val priority: Int,
val weight : Double,
val imageUrl : String?,
var quantity : Int = 0,
var selected: Boolean = false,
val gazType: String, // TRADEX, TOTAL, CAMGAZ
) : Parcelable{}
build.gradle.kts (Project)
dependencies {
//...
val nav_version = "2.3.5"
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
}
build.gradle.kts (Module)
plugins {
//...
id("androidx.navigation.safeargs.kotlin")
id ("kotlin-parcelize")
}
the problem that appear in the problem box
Unresolved reference: os
No 'Parcelable' supertype
Unresolved reference: Parcelable