Hi everyone, I'm trying to store a list in a Real...
# multiplatform
a
Hi everyone, I'm trying to store a list in a Realm object, but I'm encountering an issue with the detail property in my current model. Here's the class:
Copy code
class ProductTransDraft : RealmObject {
    @PrimaryKey
    var draftId: String = ""
    var datetime: String = ""
    var kasir: String = ""
    var subtotal: String = ""
    var detail: RealmList<ProductTrans> = RealmList()
}
The error is related to the detail property, which is supposed to store a list of ProductTrans objects. Does anyone know how to properly define and handle lists in Realm? Also, I'm considering migrating to Room before the project gets too large. Do you think it's worth the switch? I feel like Realm has less documentation and support compared to Room. Any advice would be greatly appreciated! Thanks!
not kotlin but kotlin colored 1
f
I moved from Realm to Room and haven't looked back. I got some perf issues for a relatively small DB and didn't the database sync function. What error are you getting?
a
The error is at line detail property, the instantiate is interface.. I still don't know yet how to use list in that object
f
You need to post an error for people to understand what is going on
a
Oh sorry, like this:
f
try using realmListOf() instead of RealmList()
a
Oh ok thanks