ModelInfo class

In order to represent the model stored in objectbox-model.json in Dart, several classes have been introduced. Conceptually, these classes are comparable to how models are handled in ObjectBox Java and ObjectBox Go. This is also why for explanations on most concepts related to ObjectBox models, you can refer to


ModelInfo({required List<ModelEntity> entities, required IdUid lastEntityId, required IdUid lastIndexId, required IdUid lastRelationId, required IdUid lastSequenceId, required List<int> retiredEntityUids, required List<int> retiredIndexUids, required List<int> retiredPropertyUids, required List<int> retiredRelationUids, required int modelVersion, required int modelVersionParserMinimum, required int version})
ModelInfo.fromMap(Map<String, dynamic> data, {bool check = true})


entities List<ModelEntity>
read / write
hashCode int
The hash code for this object.
lastEntityId IdUid
read / write
lastIndexId IdUid
read / write
lastRelationId IdUid
read / write
lastSequenceId IdUid
read / write
modelVersion int
read / write
modelVersionParserMinimum int
read / write
retiredEntityUids List<int>
read / write
retiredIndexUids List<int>
read / write
retiredPropertyUids List<int>
read / write
retiredRelationUids List<int>
read / write
runtimeType Type
A representation of the runtime type of the object.
version int
read / write


containsUid(int uid) bool
createEntity(String name, [int uid = 0]) ModelEntity
createIndexId() IdUid
findEntityByName(String name) ModelEntity?
findEntityByUid(int uid) ModelEntity?
findSameEntity(ModelEntity other) ModelEntity?
generateUid() int
getEntityByUid(int uid) ModelEntity
hasRelations() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
removeEntity(ModelEntity entity) → void
toMap({bool forModelJson = false}) Map<String, dynamic>
toString() String
A string representation of this object.
validate() → void


operator ==(Object other) bool
The equality operator.


notes → const List<String>
['KEEP THIS FILE! Check it into a version control system (VCS) like git.', 'ObjectBox manages crucial IDs for your object model. See docs for details.', 'If you have VCS merge conf…