MarkdownTemplate.fromYamlMap constructor
- YamlMap template
Implementation
factory MarkdownTemplate.fromYamlMap(YamlMap template) {
final checkKeys = <String>[
'name',
'type',
];
if (!template.mapHasAllKeys(checkKeys)) {
throw Exception('The config file is missing a template key.');
}
return MarkdownTemplate(
name: template['name'],
type: template['type'],
);
}