Closed yashanghan22 closed 3 months ago
ObjectBox can not know how to convert SalesCategory
to a database value, even if you add the @Property
annotation. It needs to be mapped to a supported type, like an int
or String
. See https://docs.objectbox.io/advanced/custom-types#convert-annotation-and-property-converter for an example.
Note: labeled this issue with "more info required" so it will auto-close in a few days if there are no follow-up comments.
@greenrobot-teamI, I understand that I need to assign values to each enum property, correct?
You need to add methods to convert to a database value, like shown at https://docs.objectbox.io/advanced/custom-types#convert-annotation-and-property-converter
@greenrobot-team, got it. Thanks for the solution.
cannot generating g dart file using objectbox package just because of my class has one custom type enum parameter which is causing a issue don't know it is issue or not so want to know is there any solution for this ?????
Build info
Expected behavior
it should generate g dart file if i put any enum parameter in the class
Actual behavior
it is not generating dart file and throwing error as shown below in th screenshot
Code
Code
```dart @Entity() class SalesConverterModel { @Id() int? id; @Property() Salescategory salesCategory; PartyModel? partyName; String? broker; String? onAc; String? outstate; String? qaulity; SalesConverterModel({ this.id, this.salesCategory = Salescategory.sales, this.partyName, this.broker, this.onAc, this.outstate, this.qaulity, }); } ```