isDependency function
Implementation
Future<bool> isDependency(String package, BuildStep buildStep,
{bool dev = false}) async {
final pubspec = Pubspec.parse(await buildStep
.readAsString(AssetId(buildStep.inputId.package, 'pubspec.yaml')));
var deps = pubspec.dependencies;
if (dev) {
deps = pubspec.devDependencies;
}
return deps.keys.any((key) => key == package);
}