Migration to Flutter Guide
Discover our battle-tested 21-step framework for a smooth and successful migration to Flutter!
Home
Glossary

Flutter Version Management (FVM)

What is FVM in Flutter?

Flutter Version Management, commonly known as FVM, is a tool that allows developers to manage multiple Flutter SDK versions on a single machine. It solves a common problem in Flutter app development: different projects often require different Flutter versions, and upgrading globally can easily break existing codebases.

Instead of relying on one global Flutter installation, FVM makes the Flutter SDK version a project-level concern.

Why does FVM matter in Flutter app development?

FVM matters because it makes switching between Flutter versions simple and predictable.

This is especially important when:

  • Working on multiple Flutter projects at the same time, each using a different SDK version.
  • Gradually migrating a project from one Flutter version to another.
  • Validating whether a Flutter upgrade introduces breaking changes.
  • Maintaining legacy applications while developing new ones on a newer SDK.

By pinning the Flutter version per project, FVM removes the need to constantly modify the global SDK installation. This allows developers to move between codebases instantly and safely, without worrying about unintended version changes.

How does FVM work?

FVM downloads Flutter SDK versions into a local cache directory. Each project can then be linked to a specific version using a configuration file.

When you run Flutter commands through FVM, such as fvm flutter run, FVM resolves the correct SDK version and executes the command against it. This guarantees that the same Flutter version is used regardless of what is installed globally.

Modern Flutter tooling and IDEs integrate cleanly with FVM, making the indirection mostly invisible once configured.

How to use FVM in Flutter

Using FVM typically follows three steps:

  1. Install FVM globally.
  2. Install a specific Flutter version.
  3. Bind that version to a project.

After that, all Flutter commands should be executed via FVM to ensure version consistency.

In team environments, this removes the "works on my machine" problem caused by SDK mismatches.

Best practices when using FVM

Flutter Version Management (FVM) should be used with clear practices to ensure that the correct Flutter SDK version is applied consistently across the team and CI/CD environments.

Commit the FVM configuration file

The FVM configuration file (fvm_config.json) should be committed to version control.
This ensures that every developer and build pipeline uses the same Flutter version.

At the same time, the .fvm/flutter_sdk symlink must be added to .gitignore.
Committing SDK files to the repository can lead to:

  • Very large repository sizes
  • Cross-platform issues (for example, symlinks created on macOS do not work on Windows)

Always use fvm flutter instead of global Flutter

Developers should always run fvm flutter instead of the global flutter command.

Examples include:

  • fvm flutter pub get
  • fvm flutter build

This ensures that all commands use the project-specific Flutter version, preventing subtle bugs caused by multiple SDK versions installed on the same machine.

Configure IDEs to use the FVM SDK

IDEs should be configured to point to the FVM-managed Flutter SDK.

Most editors allow specifying the Flutter SDK path. Setting this path to the FVM version helps prevent accidental usage of a global SDK and keeps debugging, Hot Reload, and code analysis consistent.

Ensure CI/CD uses the FVM version

CI/CD pipelines should also install and use the FVM-managed SDK.

Explicitly using the FVM version in build scripts ensures:

  • Reproducible builds
  • Protection against unexpected breakages caused by Flutter upgrades

Treat FVM as a central part of project architecture

Teams should treat FVM as a central part of project architecture, not optional tooling.

Recommended practices include:

  • Regularly verifying that developers use the correct Flutter version locally.
  • Using pre-commit hooks to warn about mismatched versions.
  • Documenting FVM usage for onboarding new team members.

Following these practices allows FVM to enforce SDK consistency, prevent version-related conflicts, and support collaboration across multiple environments.

Limitations of FVM

Flutter Version Management (FVM) has several limitations that developers should understand.

  • FVM does not manage dependency versions inside pubspec.yaml: It only manages the Flutter SDK version.
  • FVM introduces an extra layer of indirection: This can be confusing for beginners if the project setup is not properly documented.

Despite these limitations, the trade-off is almost always worth it for non-trivial projects.

Learn more

12 Flutter & Dart Code Hacks
by LeanCode

12 Flutter & Dart Code Hacks & Best Practices – How to Write Better Code?

In this article, we’re sharing LeanCode’s 12 practical Flutter and Dart patterns that help you write less boilerplate, make your code cleaner, and catch mistakes earlier. Apply these patterns and you'll find yourself coding faster, communicating more clearly with your teammates, and spending less time debugging issues that the compiler could have caught.

UI Testing in Flutter by LeanCode

The Role of UI Testing in Large-Scale Applications

We dive into the topic of UI testing in Flutter. Read more about automated UI tests' benefits and available solutions and why UI testing plays a crucial role, especially in large-scale applications.

Four mobile phones with small icons

Lessons Learned After Making the First 10 Commercial Apps in Flutter

There is always exciting technology our team wants to try out. We challenged them and asked for proof on how Flutter can bring value to the client. We are sharing the insights after making the first 10 commercial apps within the last 24 months during which we’ve spent some 17.193,00 hours on Flutter projects.