TemplateConfig.fromYamlString constructor
TemplateConfig.fromYamlString(
- String yamlString
Parses YAML string content.
Implementation
factory TemplateConfig.fromYamlString(String yamlString) {
try {
final doc = loadYaml(yamlString);
if (doc is! Map) {
throw const ConfigurationException('Template YAML must evaluate to a Map.');
}
return TemplateConfig.fromYamlMap(doc);
} catch (e) {
if (e is CliException) rethrow;
throw ConfigurationException('Failed to parse template YAML: $e');
}
}