ModelInfo.fromMap constructor

ModelInfo.fromMap(
  1. Map<String, dynamic> data, {
  2. bool check = true,
})

Implementation

ModelInfo.fromMap(Map<String, dynamic> data, {bool check = true})
    : entities = [],
      lastEntityId = IdUid.fromString(data['lastEntityId'] as String?),
      lastIndexId = IdUid.fromString(data['lastIndexId'] as String?),
      lastRelationId = IdUid.fromString(data['lastRelationId'] as String?),
      lastSequenceId = IdUid.fromString(data['lastSequenceId'] as String?),
      retiredEntityUids = _uids(data['retiredEntityUids']),
      retiredIndexUids = _uids(data['retiredIndexUids']),
      retiredPropertyUids = _uids(data['retiredPropertyUids']),
      retiredRelationUids = _uids(data['retiredRelationUids']),
      modelVersion = data['modelVersion'] as int? ?? 0,
      modelVersionParserMinimum =
          data['modelVersionParserMinimum'] as int? ?? _maxModelVersion,
      version = data['version'] as int? ?? 1 {
  ArgumentError.checkNotNull(data['entities'], "data['entities']");
  for (final e in data['entities']) {
    entities.add(ModelEntity.fromMap(e as Map<String, dynamic>,
        model: this, check: check));
  }
  if (check) validate();
}