Reputation: 512
So, I’m using flutter version 2.2.3 and can’t upgrade right now. But, my other project need higher SDK. I know, there is FVM. But I found this: How to use two version of flutter on same device for different projects? and cite the article: https://dartcode.org/docs/quickly-switching-between-sdk-versions/
The article said, we can quickly switch flutter version via clickable status bar after applied git worktree. But, in my VSCode, flutter version not clickable.
Any suggestion please?
Upvotes: 3
Views: 14313
Reputation: 91
Using FVM you can manage and change you're machine's default and have VS code reference that default path so it's always synced between your terminal and IDE.
Edit your VS Code settings.json
with
{
"dart.flutterSdkPath": "/Users/user-name/fvm/default/bin",
}
or whatever your fvm default path is
Upvotes: 0
Reputation: 41
seems that: if you get it set in this file, you can't change the current VS code project's flutter version anywhere else.
Upvotes: 1
Reputation: 1807
FVM is a good choice, but if you want to use built-in mechanism, you'll have to:
.vscode/settings.json
file for single project or globally in settings):{
"dart.sdkPaths": [
"/Users/user/flutter/stable"
"/Users/user/flutter/beta"
]
}
Upvotes: 4
Reputation: 512
I’ve found the answer:
And voila! I can choose other versions
Upvotes: 16
Reputation: 357
if you are using vs code you can click ctrl+shift+p
or command+shift+p
and search for "select SDK" and select your SDK.
Upvotes: 1