Is it safe to delete .dart_tool folders?
Files that Dart and Flutter tools generate in each project, such as its package configuration and build caches.
Safe
Its owner recreates it by itself when it needs it, and nothing you made is lost.
~/
- Only next to pubspec.yaml
- Never inside ~/
Library, ~/ **/ packages/ flutter_tools
What it is
Dart's tools, including pub, the build system and Flutter, keep generated files for a project in a hidden .dart_tool folder next to its pubspec.yaml file. The folder isn't meant to be kept with your code, and it's created again when the project's dependencies are fetched, which Flutter does on its own when you run or build an app. Flutter's clean command removes the same folder.
If it's removed
The next run or build of the project fetches its dependencies again and takes longer.
How it's removed
Moved to the Trash, where you can restore it.
The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It starts checked in the Cleanup checklist, except inside Documents or Desktop.
Sources
- dart.dev/tools/pub/private-files
- docs.flutter.dev/reference/flutter-cli
- github.com/dart-lang/sdk/issues/50422
Last checked on 26 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.