uninstallCliPackage function

Future<bool> uninstallCliPackage(
  1. String package, {
  2. bool? verbose,
})

Uninstall a package installed with dart install.

Returns true if the package was uninstalled during this call.

Implementation

Future<bool> uninstallCliPackage(String package, {bool? verbose}) async {
  verbose ??= false;
  if (!await isCliPackageInstalled(package, verbose: verbose)) {
    return false;
  }
  await run('dart uninstall $package', verbose: verbose);
  _installedCliPackages?.remove(package);
  return true;
}