removeDependencies static method
Implementation
static Future<void> removeDependencies(String package,
{bool logger = true}) async {
if (logger) LogService.info('Removing package: "$package"');
await ShellUtils.removePackage(package);
if (!containsPackage(package)) {
// var dependencies = pubSpec.dependencies;
// var devDependencies = pubSpec.devDependencies;
// dependencies.removeWhere((key, value) => key == package);
// devDependencies.removeWhere((key, value) => key == package);
// pubSpec.dependencies.clear();
// pubSpec.devDependencies.clear();
// pubSpec.dependencies.addAll(dependencies);
// pubSpec.devDependencies.addAll(devDependencies);
// var newPub = pubSpec.copy(
// devDependencies: devDependencies,
// dependencies: dependencies,
// );
// _savePub(pubSpec);
if (logger) {
LogService.success(LocaleKeys.sucess_package_removed.trArgs([package]));
}
} else if (logger) {
LogService.info(LocaleKeys.info_package_not_installed.trArgs([package]));
}
}