如何清理过时的酒吧

时间:2020-02-29 04:13:48

标签: flutter dart-pub

如图所示,我的本地有多个相同酒吧的版本:

  • .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

有没有办法清洁它们? 或通过提供minimal dart version清洁它们。 (例如mini dart > 2.6.0)?

enter image description here

2 个答案:

答案 0 :(得分:1)

我认为没有命令。因为pub无法知道您周围是否有旧项目取决于这些旧软件包版本之一。

清除旧软件包的最简单方法是完全删除.pub-cache。首次运行flutter pub get时,将重新下载您实际使用的版本。这样可以消除未使用的。

答案 1 :(得分:1)

flutter 1.17提供了新的推荐:flutter pub outdated。在这方面进展良好。