fvm
fvm copied to clipboard
How should I configure the fvm, I can make sure that the default global version is used under the global and the version specified by the fvmrc is used under the project
How should I configure the fvm, I can make sure that the default global version is used under the global and the version specified by the fvmrc is used under the project
Now that I have these versions, I want flutter doctor to be the default global stable globally, and if flutter doctor is under project I want it to be the version specified by fvmrc
you can use this https://github.com/leoafarias/fvm/issues/787
Great question, @maxfrees! Good news - FVM already does exactly what you want, automatically! No special configuration needed 🎉
How It Works
FVM automatically uses the right version based on where you are:
In a project directory (with .fvmrc):
cd ~/my-project
flutter doctor # Uses version from .fvmrc
Outside a project (or no .fvmrc):
cd ~
flutter doctor # Uses global version
Setup
- Set your global version:
fvm global stable
- Set project versions:
cd ~/my-project
fvm use 3.24.0 # Creates .fvmrc with this version
That's it! FVM handles the rest automatically.
How FVM Resolves Versions
When you run fvm flutter (or flutter if using PATH), FVM checks in this order:
- Current directory
.fvmrc→ Use this version - Parent directories
.fvmrc→ Use first one found - Global version (
fvm global) → Use this - System Flutter → Last resort
Verify It's Working
Check which version FVM will use:
# In your project
cd ~/my-project
fvm flutter --version # Should show project version
# Outside project
cd ~
fvm flutter --version # Should show global version
Check your current setup:
fvm list
# Shows all installed versions
# Global version marked with (global)
# Current project version marked with (active)
No Configuration Needed!
You don't need to configure anything special. As long as you:
- ✅ Set global with
fvm global stable - ✅ Set project with
fvm use <version>in each project
FVM automatically handles which version to use based on your current directory.
Let me know if you need any clarification!
Closing as this is how FVM works by default.
Question answered - FVM handles this automatically