DEV Community

Cover image for The Ultimate Guide to Flutter Version Management for Every Developer Level
Md. Al-Amin
Md. Al-Amin

Posted on

The Ultimate Guide to Flutter Version Management for Every Developer Level

Whether you're just starting out in Flutter or you’ve been shipping apps for years, you've probably faced the challenge of switching between Flutter versions. Maybe one project uses Flutter 3.10, and another needs the latest 3.22 and that’s where FVM (Flutter Version Management) becomes your best friend.

In this post, I’ll Walk you through everything about FVM what it is, why it matters, how to use it across skill levels, and how to keep your setup clean and efficient.


What is FVM?

FVM (Flutter Version Management) is a simple CLI tool that lets you manage and switch between multiple Flutter versions effortlessly.

Why use it?

  • Different projects often need different versions of Flutter.
  • Avoid corrupting global Flutter installations.
  • Manage dependencies and CI/CD pipelines with consistent Flutter versions.

FVM brings structure, clarity, and ease especially when juggling multiple Flutter apps or collaborating on teams.


Installing FVM

You can install FVM using one of the following methods:

With pub (recommended for Dart users):

dart pub global activate fvm
Enter fullscreen mode Exit fullscreen mode

With Homebrew (macOS):

brew tap leoafarias/fvm
brew install fvm
Enter fullscreen mode Exit fullscreen mode

With Scoop (Windows):

scoop bucket add fvm https://github.com/leoafarias/fvm
scoop install fvm
Enter fullscreen mode Exit fullscreen mode

Beginner Guide: Using FVM as a New Flutter Dev

As a beginner, the goal is to start using FVM without too much complexity.

  1. Initialize FVM in your project
fvm use stable
Enter fullscreen mode Exit fullscreen mode

This creates a .fvm folder and a fvm_config.json that tells FVM to use the stable version for this project.

  1. Run Flutter commands through FVM Instead of:
flutter run
Enter fullscreen mode Exit fullscreen mode

Use:

fvm flutter run
Enter fullscreen mode Exit fullscreen mode

Tip: You can also set up an alias in your terminal to make this seamless.

  1. See which versions you have installed:
fvm list
Enter fullscreen mode Exit fullscreen mode

Intermediate Guide: Managing Multiple Projects

Now you're building multiple apps or contributing to others. Some may use beta or specific versions.

  1. Use a custom version:
fvm use 3.13.6
Enter fullscreen mode Exit fullscreen mode

This will download and use version 3.13.6 locally in your project.

  1. Install any Flutter version globally:
fvm global 3.16.5
Enter fullscreen mode Exit fullscreen mode

Now your terminal's default flutter command will use this version.

  1. Add .fvm/flutter_sdk to .gitignore

You don’t need to commit the whole Flutter SDK — just the config. Add this to your .gitignore:

.fvm/flutter_sdk
Enter fullscreen mode Exit fullscreen mode

Real-World Example: Managing Flutter Versions Across Two Projects

Let’s say you’re working on two different apps:

  • ClientApp: A legacy project built with Flutter 3.10.5
  • StartupX: A modern app using Flutter 3.22.0 (latest stable)

Here’s how FVM helps you handle both easily:

Step-by-Step Workflow with FVM

Project 1: ClientApp (Flutter 3.10.5)

cd ~/Projects/ClientApp
fvm use 3.10.5
Enter fullscreen mode Exit fullscreen mode

Then:

fvm flutter pub get
fvm flutter run
Enter fullscreen mode Exit fullscreen mode

Project 2: StartupX (Flutter 3.22.0)

cd ~/Projects/StartupX
fvm use 3.22.0
Enter fullscreen mode Exit fullscreen mode

Run as usual with:

fvm flutter run
Enter fullscreen mode Exit fullscreen mode

Each project now uses its own Flutter SDK version without interference.


Folder Structure Behind the Scenes

FVM stores all versions in a central directory:

~/.fvm/versions/
  ├── 3.10.5/
  └── 3.22.0/
Enter fullscreen mode Exit fullscreen mode

Each project just points to the version it needs saving space and avoiding conflicts.


Collaborating with Teams

Include the .fvm/fvm_config.json file in your repo so everyone on your team uses the same Flutter version.

In your project’s .gitignore, make sure this is excluded:

.fvm/flutter_sdk
Enter fullscreen mode Exit fullscreen mode

Then, when a teammate clones the project, all they need to do is:

fvm install
Enter fullscreen mode Exit fullscreen mode

FVM will automatically install and configure the correct Flutter version.


Cleaning Up Old Versions

Let’s say you're done working on ClientApp. Free up space:

fvm list
fvm remove 3.10.5
Enter fullscreen mode Exit fullscreen mode

Done. Clean and simple!


Pro Guide: Supercharging FVM Workflow

  1. Use FVM with CI/CD Add these lines to your pipeline config:
dart pub global activate fvm
fvm install
fvm flutter pub get
Enter fullscreen mode Exit fullscreen mode
  1. Set Terminal Aliases To avoid typing fvm before every command, add this to .bashrc, .zshrc, or .config/fish/config.fish:
alias flutter='fvm flutter'
alias dart='fvm dart'
alias pub='fvm flutter pub'
Enter fullscreen mode Exit fullscreen mode

Now you can run commands as usual:

flutter pub run
dart format .
Enter fullscreen mode Exit fullscreen mode

Best Practices for FVM

✅ Use fvm use per project
✅ Add .fvm/flutter_sdk to .gitignore
✅ Share fvm_config.json in your repo
✅ Run fvm install on new machines or CI
✅ Remove unused versions regularly
✅ Use aliases for a smoother experience


FVM Cheat Sheet

  • fvm list List installed Flutter versions
  • fvm releases List available Flutter releases
  • fvm install <version> Download a Flutter version
  • fvm remove <version> Delete an unused version
  • fvm use <version> Use version for current project
  • fvm global <version> Set global default version
  • fvm flutter <cmd> Run Flutter command via FVM

Final Thoughts

FVM is more than a version switcher it’s a workflow optimizer. Whether you’re a solo dev or part of a large team, integrating FVM into your toolkit keeps your projects clean, consistent, and future proof.

A cleaner workspace = a smoother dev experience.
Make FVM your Flutter superpower today. 💙

Top comments (0)