remove method

Future<List<String>> remove(
  1. String package
)

Deletes the patches for package (a name or a cache folder name) and resets that package in the project cache. Returns the removed paths.

Implementation

Future<List<String>> remove(String package) async {
  final matching = [
    for (final patch in patches())
      if (patch.packageName == package || patch.folder == package) patch,
  ];
  for (final patch in matching) {
    if (_applyDirectory(patch) != null) {
      await _reset(patch);
    }
    patch.file.deleteSync();
  }
  return [for (final patch in matching) patch.relativePath];
}