As the image show, there are several versions of same pubs in my local:
.pub-cache/hosted/pub.dartlang.org/some-version1
. .pub-cache/hosted/pub.dartlang.org/some-version2
. .pub-cache/hosted/pub.dartlang.org/some-version3
. .pub-cache/hosted/pub.dartlang.org/some-version4
. Is there a way to clean them ?
Or clean them by provide a minimal dart version
. (like mini dart > 2.6.0
) ?
I don't think there is a command for that. Because pub cannot know whether you have an old project lying around that depends on one of these older package versions or not.
The easiest way to clean away old packages is to just delete .pub-cache
altogether. When you first run flutter pub get
the ones that you actually use will be re-downloaded. This would get rid of the unused ones.
flutter 1.17
provided a new commend: flutter pub outdated
. which have good progress on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With