getConfig function
Implementation
YamlMap? getConfig(String? yamlFile) {
if (yamlFile == null) return null;
final File file = File(yamlFile);
if (!file.existsSync()) {
throw Exception('The config file `$yamlFile` was not found.');
}
final yamlMap = loadYaml(file.readAsStringSync());
if (yamlMap is! YamlMap) return null;
return yamlMap;
}