The difference between flutter flutter pub cache clean and flutter clean

flutter pub cache cleanand flutter cleanare two different commands in Flutter development, and their functions and usage scenarios are different.

  1. flutter pub cache clean: This command is used to clear Flutter’s package cache. When using Flutter for development, some third-party dependency packages will be downloaded and cached, and these packages will be saved in Flutter's package cache. flutter pub cache cleanThe command can clear these caches. You can use this command when you need to clear the cache and re-download the dependent packages.

  2. flutter clean: This command is used to clean the build files of the Flutter project. When you build in a Flutter project, some build files and output directories will be generated, such as generated APK files, build cache, etc. flutter cleanThe command can clear these build files. You can use this command when you need to clean the build files and rebuild the project.

In summary, flutter pub cache cleanit is mainly used to clean the Flutter package cache, and flutter cleanis mainly used to clean the project's build files. Their usage scenarios and purposes are different. Choose the appropriate command according to your specific needs.

Guess you like

Origin blog.csdn.net/weixin_44911775/article/details/135246123