FVM — Pinning the Flutter Version
Flutter ships new stable versions several times a year. Sprout builds fine on your laptop; a friend clones it and gets a wall of errors because their Flutter is a few releases older. Nothing is wrong with the code. The two of you are simply compiling it with different SDKs.
The rule
One project, one pinned Flutter version, written down in the repo.
FVM (Flutter Version Management) is a command-line tool that keeps several Flutter SDKs on one machine and lets each project choose its own.
fvm install 3.24.0 # download that SDK into FVM's cache
fvm use 3.24.0 # pin it for the project in this folder
fvm flutter --version # run flutter through the pinned SDK
fvm flutter runfvm usewrites the chosen version into a small config file in the project (.fvmrcin current FVM). Commit that file so everyone reads the same pin.- FVM also makes a local
.fvmfolder that links to the SDK on your machine. That folder is machine-specific, so it stays out of Git. fvm flutter ...is the everyday form: it forwards any command to the pinned SDK. Plainflutterstill uses your global install.- Editors can be pointed at the pinned SDK too, so the analyzer and the terminal agree.