Skip to content

Flutter keeps an SDK, a pub cache and a build folder per project

The engine artefacts per platform are the surprise. Where everything lives on Windows and what each command clears.

5 min read

Flutter is generous with disk in three places at once, and clearing one does nothing for the other two. Knowing which is which turns a vague several gigabytes into three specific numbers.

The three places

flutter doctor -v | Select-String 'Flutter version|Framework|Engine'
Get-ChildItem "$env:LOCALAPPDATA\Pub\Cache","$env:USERPROFILE\flutter" -EA SilentlyContinue |
  ForEach-Object {
    $s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
    '{0,8:N0} MB  {1}' -f ($s/1MB), $_.FullName
  }
LocationWhat it isHow to shrink it
The SDK folderFramework, tools and a cached engine per platformRemove unused platform artefacts
%LOCALAPPDATA%\Pub\CacheEvery version of every package ever fetcheddart pub cache clean
build and .dart_tool per projectCompiled outputflutter clean

The pub cache is in Local AppData on Windows rather than a dotfolder in the home directory, which is why the paths in most tutorials do not match.

Engine artefacts per platform

Get-ChildItem "$env:USERPROFILE\flutter\bin\cache\artifacts" -Directory -EA SilentlyContinue |
  ForEach-Object {
    $s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
    [PSCustomObject]@{ MB = [math]::Round($s/1MB); Name = $_.Name }
  } | Sort-Object MB -Descending

The SDK downloads prebuilt engine binaries for every platform it has been asked about. On a Windows machine targeting Android, web and Windows desktop, that is three sets, and flutter precache with specific platform flags is the supported way to end up with fewer.

Build output across projects

Get-ChildItem $env:USERPROFILE -Recurse -Directory -Include build,.dart_tool -Depth 5 -EA SilentlyContinue |
  Where-Object { Test-Path (Join-Path $_.FullName '..\pubspec.yaml') } |
  Select-Object FullName -First 20

The check for a pubspec.yaml alongside is what distinguishes a Flutter build folder from every other folder called build. Both are regenerated by the next build.

The Android side

A Flutter machine targeting Android also carries the SDK, system images and Gradle caches, which are usually larger than Flutter itself. Those are in Android Studio on Windows.

Common questions

Where is the Flutter pub cache on Windows?

In %LOCALAPPDATA%\Pub\Cache, not a dotfolder in the home directory as on Unix. That is why paths in most tutorials do not match a Windows machine.

What does flutter clean delete?

The build and .dart_tool folders in the current project, both regenerated by the next build. It does not touch the SDK or the pub cache.

Can I remove Flutter engine artefacts?

Yes, and flutter precache with platform flags redownloads only the ones you need. The SDK keeps prebuilt engines for every platform it has been asked about.

Why is my Flutter setup so large on Windows?

The SDK with engine artefacts per platform, the pub cache holding every package version ever fetched, and a build folder per project. On an Android machine the SDK and emulators are larger still.

Read next