parseFile method
Implementation
Future<Map<String, dynamic>> parseFile(String filePath) async {
final file = File(filePath);
if (!await file.exists()) {
throw Exception('Configuration file not found: $filePath');
}
final yamlString = await file.readAsString();
final yamlMap = loadYaml(yamlString);
if (yamlMap is! YamlMap) {
throw Exception('Invalid YAML format');
}
return yamlMap.cast<String, dynamic>();
}