Skip to the workspace
Pebellslearn by building
Development Environment  ›  Lesson

FVM — Pinning the Flutter Version

FVM 12 minFVM installs several Flutter SDK versions side by side and pins one per project, so everyone building the project uses the same version.

flutter / FVM — Pinning the Flutter Version

Explore each scene at your own pace.

01 · The rule

The rule

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 run
  • fvm use writes the chosen version into a small config file in the project (.fvmrc in current FVM). Commit that file so everyone reads the same pin.
  • FVM also makes a local .fvm folder 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. Plain flutter still uses your global install.
  • Editors can be pointed at the pinned SDK too, so the analyzer and the terminal agree.
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.