getModelByName method

Model? getModelByName(
  1. ItemType itemType
)

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;
}