Closed raphire08 closed 2 years ago
To be able to store the data in binary format (as used by the database), it has to be typed statically, otherwise, the generator doesn't know how to create the right code to serialize the variable.
On the other hand, you can store just about anything, just convert it to one of the known formats (e.g. serialize yourself using JSON to a string/blob). You can read up on how to do so in the docs: https://docs.objectbox.io/advanced/custom-types
Supporting dynamic types isn't in scope, at least not at the moment. As said above, converters are an alternative. If there are more questions, feel free to reopen.
Create an Entity with
dynamic
orvar
as one of the fields. Run build runner. Build runner throws error. What could be the workaround to have a dynamic variable in entity class.Gettting this warning [WARNING] objectbox_generator:resolver on lib/entity/shape_temp.dart: skipping property 'var1' in entity 'Shape', as it has an unsupported type: 'dynamic' [WARNING] objectbox_generator:resolver on lib/entity/shape_temp.dart: skipping property 'var2' in entity 'Shape', as it has an unsupported type: 'dynamic'