Flutter projects are small until you run them. Build for Android, iOS, web and desktop and the project folder can grow by gigabytes. Almost all of it is regenerated on demand, which makes Flutter one of the most satisfying things to clean.
The two folders that matter
build/is the output of everyflutter runandflutter build: APKs and app bundles, iOS and macOS build products, web bundles, and intermediate files for each platform you’ve targeted. This is usually the big one..dart_tool/holds Dart tooling state: the package configuration written bypub get, build_runner and code-generation caches, and other tool data. Smaller, but it’s regenerated byflutter pub get.
Both are safe to delete. Neither contains your code, assets or pubspec.lock.
What flutter clean does
flutter clean deletes build/ and .dart_tool/ for the current project (plus some platform-specific ephemeral files), so the next build starts from scratch. Afterwards, fetch packages again:
Quick check: what’s safe?
The bigger Flutter caches outside your project
Project folders are only part of it. Flutter development also fills these shared locations. Clean them deliberately, knowing every project uses them:
- Pub cache (
~/.pub-cacheon macOS and Linux,%LOCALAPPDATA%\Pub\Cacheon Windows). Rundart pub cache cleanto wipe it, and expect every project to download packages again. - Gradle (
~/.gradle/caches), used by every Android build. - CocoaPods (
~/Library/Caches/CocoaPods), cleared withpod cache clean --all. - Xcode DerivedData (
~/Library/Developer/Xcode/DerivedData). See the Mac developer cleanup checklist.
The fast way for many projects
Running flutter clean in thirty folders is slow, because the Flutter tool has to start each time. Gigaflush finds build/ and .dart_tool/ in every Flutter project under a folder, shows sizes, and removes the ones you pick in one pass, alongside any node_modules, Rust target and other build output in the same scan.