dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
213 stars 71 forks source link

Wait for a `resume` event to run the `main()` method after a page refresh #2431

Closed elliette closed 1 month ago

elliette commented 1 month ago

I was putting together a doc about the many places we wait for a resume event after either a hot-restart or a page-refresh when pauseIsolatesOnStart is true, and realized that I had missed waiting for the resume event for page refreshes when running an app with flutter_tools.

I then realized that the solution implemented for waiting for a resume event after a page-refresh for internal apps (https://github.com/dart-lang/webdev/pull/2398 and cl/626138927) could be modified to work for both flutter_tools and internal apps. These modifications are in this PR.

Before this change:

With this change:

Work towards https://github.com/flutter/devtools/issues/7231

Requires cl/632610137 to be submitted as well