pathPubspecAddDependency function
Returns true if added
Implementation
Future<bool> pathPubspecAddDependency(String dir, String dependency,
{List<String>? dependencyLines}) async {
var map = await pathGetPubspecYamlMap(dir);
if (!pubspecYamlHasAnyDependencies(map, [dependency])) {
var content = _loadPubspecContent(dir);
content = pubspecStringAddDependency(content, dependency,
dependencyLines: dependencyLines);
await _writePubspecContent(dir, content);
return true;
}
return false;
}