Ben Konyi 101ace2140
[ Widget Preview ] Always generate scaffold under $TMP (#179039)
Since `flutter clean` can delete the `.dart_tool/` directory while a
`flutter widget-preview start` command is active, it's possible for the
`widget_preview_scaffold` to be deleted and cause the preview process to
crash.

This change works around this issue by always generating the
`widget_preview_scaffold` project under $TMP on each invocation of the
previewer. This doesn't result in much of a regression in startup times
as we currently aren't launching the previewer using restored state as
this isn't currently possible with the web device targets. Moving the
scaffold under $TMP means Flutter tooling will never accidentally delete
the scaffold while the previewer is running.

Filed https://github.com/flutter/flutter/issues/179036 to track
reverting this behavior when a better solution is found.

Fixes https://github.com/flutter/flutter/issues/175058
2025-11-24 20:48:36 +00:00
..
2025-10-09 19:18:12 +00:00