mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
A soft restart simply removes the previewed widget from the widget tree for a frame before re-inserting it on the next frame. This has the effect of re-running local initializers in `State` objects, which would normally require a hot restart to accomplish. This reduces the number of cases where a full hot restart of the preview environment would be needed to pick up state-related changes. Fixes https://github.com/flutter/flutter/issues/166450 **Updated Controls:**  **Demo:** updates a string initialized in `initState`, triggering a hot reload. The updated string isn't rendered until the restart button is pressed, causing the widget to be reloaded with the new state initialized. https://github.com/user-attachments/assets/ab4abf8a-7823-491a-ad90-f83d877600ec