getModelByName method
Implementation
Model? getModelByName(ItemType itemType) {
if (itemType is! ObjectType) return null;
final model =
models.firstWhereOrNull((model) => model.name == itemType.name);
if (model == null) {
throw Exception(
'getModelByname is null: because `${itemType.name}` was not added to the config file');
}
return model;
}