deactivateGlobalPackage method

Future<void> deactivateGlobalPackage(
  1. String name, {
  2. bool? dryRun,
  3. bool? verbose,
})

Deactivate package

Implementation

Future<void> deactivateGlobalPackage(
  String name, {
  bool? dryRun,
  bool? verbose,
}) async {
  dryRun ??= false;
  verbose ??= false;

  String cmd;
  cmd = 'dart pub global deactivate $name';
  if (dryRun) {
    stdout.writeln(cmd);
  } else {
    if (verbose) {
      stdout.writeln('deactivating: $name');
    }
    await Shell(verbose: verbose).run(cmd);
  }
}