YmlGeneratorConfig.merge constructor

YmlGeneratorConfig.merge(
  1. Iterable<YmlGeneratorConfig> configs,
  2. String dirName
)

Implementation

YmlGeneratorConfig.merge(Iterable<YmlGeneratorConfig> configs, String dirName)
    : fileName = dirName {
  final names = <String, YmlGeneratorConfig>{};
  for (final config in configs) {
    for (final model in config.models) {
      if (names.containsKey(model.name)) {
        throw Exception(
            'Model with same name ${model.name} found in multiple files: ${names[model.name]!.fileName} and ${config.fileName}');
      }
      names[model.name] = config;
    }
    _models.addAll(config.models);
  }
}