You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[web] Custom Flutter initialization should survive hot restart #108403
The current flutter.js initialization flow does not support hot restart with custom initialization, because after the original promise is resolved, it cannot be resolved anymore.
The current workaround is to remove the didCreateEngineInitializer method once it's been used, but that reverts the initialization of flutter to "Auto" (and defaults). This won't play well with the next steps of embedding flutter in a custom element, or any other data that we might want to pass from JS to a flutter app.
// Remove the public method after it's done, so Flutter Web can hot restart.
delete this.didCreateEngineInitializer;
flutter.js should support multiple hot restarts, keeping the custom initialization. To do so, a new onEngineInitialized API might need to be added to the flutter loader, so programmers can subscribe to Hot Restart events, rather than waiting for the resolution of a promise (that only happens the first time)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
github-actions commentedon Aug 17, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.