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
Prompt to run "flutter pub get" if project references a different Flutter SDK to the one being used for analysis #3540
Is your feature request related to a problem? Please describe.
vscode supports adding multiple paths to flutter sdk, which allows us to switch between multiple versions of flutter and it works pretty well. I have set it up this way as answered in this stackoverflow thread but the problem is when we switch the version and when I look at the definition of any class, I see that it still points to the old SDK's code. The changes only gets reflected when we call flutter pub get
Describe the solution you'd like
So the solution I think is when we change the path to sdk the plugin should also call flutter pub get so that it points to correct class definitions.
changed the title [-]switching between multiple flutter sdks[/-][+]Prompt to run "flutter pub get" if project references a different Flutter SDK to the one being used for analysis[/+]on Aug 26, 2021
I slightly generalised this - when checking at startup whether a project needs "pub get" running, we'll now also check whether it references the Flutter SDK, and if so, whether it's the same version we're using for analysis. This means we'll detect this mismatch even if you didn't just switch SDK (eg. you globally changed your Flutter SDK path with another project open, and then switched to this project).
Thanks, that was so quick, Just curious will this change be available in the next upcoming plugin release or does the plugin get an update on each merge?
The plugin is updated approximately monthly. This change will be in the upcoming release, though you can grab the beta if you want to try it out sooner (if you install the beta, once the release is published, VS Code should automatically migrate you back to it):
Activity
[-]switching between multiple flutter sdks[/-][+]Prompt to run "flutter pub get" if project references a different Flutter SDK to the one being used for analysis[/+]DanTup commentedon Aug 26, 2021
I slightly generalised this - when checking at startup whether a project needs "pub get" running, we'll now also check whether it references the Flutter SDK, and if so, whether it's the same version we're using for analysis. This means we'll detect this mismatch even if you didn't just switch SDK (eg. you globally changed your Flutter SDK path with another project open, and then switched to this project).
maheshj01 commentedon Aug 26, 2021
Thanks, that was so quick, Just curious will this change be available in the next upcoming plugin release or does the plugin get an update on each merge?
DanTup commentedon Aug 26, 2021
The plugin is updated approximately monthly. This change will be in the upcoming release, though you can grab the beta if you want to try it out sooner (if you install the beta, once the release is published, VS Code should automatically migrate you back to it):
https://github.com/Dart-Code/Dart-Code/releases/tag/v3.26.0-beta.1