fetchConfig method
Fetches and maps configuration data from the sort_dependencies.yaml file.
Reads the configuration file line by line and converts valid entries into a map.
Each line should follow the format key: value. Lines with invalid or missing keys
are ignored.
Implementation
Map<String, Object>? fetchConfig() {
final configLines = _fetchConfigLines();
if (configLines == null || configLines.isEmpty) return null;
final mappedConfigEntries = configLines.map(
(line) {
final entry = _mapLineToEntry(line);
return entry ?? MapEntry('', '');
},
).toList()
..removeWhere((e) => e.key.isEmpty);
return Map.fromEntries(mappedConfigEntries);
}