Skip to content

widget_preview_scaffold/build folder can grow very large #179139

@DanTup

Description

@DanTup

Steps to reproduce

I was cleaning up a disk (after running out of space!) and found that some of the widget preview build folders were very large.

I don't have good steps to reproduce because this happened over time, but (based on a brief chat with @bkonyi) I suspect if you use the widget preview a lot and trigger lots of reloads, this will happen.

Expected results

If these folders are created for each build/reload, the old versions should be cleaned up.

Actual results

The files just build up over time.

Code sample

N/A

Screenshots or Video

Image Image

Logs

N/A

Flutter Doctor output

Doctor output

Note: These files built up over time, so may not have come from this specific version of Flutter.

[!] Flutter (Channel master, 3.39.0-1.0.pre-302, on Microsoft Windows [Version 10.0.26100.7171], locale en-GB) [2.5s]
    • Flutter version 3.39.0-1.0.pre-302 on channel master at D:\Dev\Google\Flutter\Flutter main
    ! Warning: `dart` on your path resolves to D:\Tools\Dart\Stable\bin\dart.exe, which is not inside your current Flutter SDK checkout at
      D:\Dev\Google\Flutter\Flutter main. Consider adding D:\Dev\Google\Flutter\Flutter main\bin to the front of your path.
    ! Upstream repository git@github.com:DanTup/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to git@github.com:DanTup/flutter.git to dismiss this error.
    • Framework revision fde117b7b1 (2 hours ago), 2025-11-26 08:17:53 -0500
    • Engine revision fde117b7b1
    • Dart version 3.11.0 (build 3.11.0-169.0.dev)
    • DevTools version 2.52.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Windows Version (11 Pro 64-bit, 24H2, 2009) [871ms]

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.2s]
    • Android SDK at C:\Users\danny\AppData\Local\Android\sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Chrome - develop for the web [62ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.5) [62ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.10.35122.118
    • Windows 10 SDK version 10.0.26100.0

[✓] Connected device (3 available) [146ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26100.7171]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 142.0.7444.176
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 142.0.3595.80

[✓] Network resources [202ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: widget previewsIssues related to the Widget Previewer toolingteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions