DanTup · GitHub

@DanTup

…it's up-to-date
If the local Flutter SDK has recently been upgraded, the Dart SDK on-disk might be out of date and the first invocation of `flutter` may kick off a download to fix this.
Before this change, if there was a Dart SDK at all, we assumed it was all initialized correctly and proceeded to start up and spawn the analysis server, but this could then crash if Flutter started replacing the Dart SDK at the same time.
With this change, we will _always_ run a `flutter` command (`flutter --help` because it's faster than `--version` which seems to do some other work) before proceeding. In the case where things are good, this may add ~1s to the startup, but this is better than the random failures.
The "Flutter is initializing.." notification is now shown only if the process is still going after 5s, to avoid it showing quickly for everyone in the case of things working normally.
Fixes #5971

Read the original on github.com ↗