mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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