type property

PropertyType? type
final

Set to store a Dart type as an alternative ObjectBox PropertyType.

For example, a Dart int (64-bit signed integer) value can be stored as a shorter integer value. Or a double (64-bit floating point) can be stored as float (32-bit).

Set signed to false to change that integers are treated as unsigned when executing queries or creating indexes.

// Store int as a byte (8-bit integer)
@Property(type: PropertyType.byte)
int? byteValue;

// Same, but treat values as unsigned for queries and indexes
@Property(type: PropertyType.byte, signed: false)
int? unsignedByteValue;

Implementation

final PropertyType? type;