我在颤振/飞镖上使用 ObjectBox (3.0.0) 来实现数据库部分。在一个实体中,我希望添加一个枚举类型列表。
enum ExampleEnum {
exampleOne,
exampleTwo,
...
}
@Entity()
class Examples {
/// ObjectBox 64-bit integer ID property, mandatory.
int id = 0;
/// List of Examples.
List<ExampleEnum> examples = [];
}
我收到此警告:
[WARNING] objectbox_generator:resolver on lib/entity/examples.dart:
skipping property 'examples' in entity 'Examples', as it has an unsupported type: 'List<ExampleEnum>'
如果我尝试通过 List 仅将枚举索引存储在 ExampleEnum 类型中,我会收到此错误:
[WARNING] objectbox_generator:resolver on lib/entity/examples.dart:
skipping property 'examples' in entity 'Examples', as it has an unsupported type: 'List<int>'
如何在我的 Entity 中正确存储枚举类型列表?