parsePubspec function
Parses pubspec.yaml and returns a map of its contents.
Implementation
Map<String, dynamic>? parsePubspec(String path) {
final file = File(path);
if (!file.existsSync()) return null;
try {
final content = file.readAsStringSync();
final doc = loadYaml(content);
return Map<String, dynamic>.from(doc as Map);
} catch (_) {
return null;
}
}