checkAndActivatePackage function

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

Returns true if the package was activated during this call.

Implementation

Future<bool> checkAndActivatePackage(String package, {bool? verbose}) async {
  var list = await getInstalledGlobalPackages(verbose: verbose);
  if (!list.contains(package)) {
    await _pubGlobalActivate(package, verbose: verbose);
    return true;
  }
  return false;
}