Flutter command to delete packages in .pub-cache folder

D.Dharanidharan picture D.Dharanidharan · Oct 9, 2019 · Viewed 24.8k times · Source

How to delete the flutter packages in .pub-cache folder? When we give flutter clean, it will delete the build folder in the current directory. We can delete it manually, but my requirement is to delete the packages in .pub-cache folder using the command.

Answer

victwise picture victwise · Oct 9, 2019

If a dependency is removed from the pubspec and then pub get is run, it removes the dependency from the .packages file, making the dependency unavailable for importing.

If a packages in your pub cache to change or break, you can use flutter pub cache repair command performs a clean reinstall of all hosted and git packages in the system cache.