For the complete documentation index, see llms.txt. This page is also available as Markdown.

FVM

Fix Flutter version for your team with FVM

When we build Flutter projects in a team, using different Flutter versions can create hard bugs. So I use FVM (Flutter Version Management) to fix one Flutter version for the project.

My goals are simple:

  • New teammates can set up quickly.

  • The whole team uses the same Flutter version.

  • We can upgrade or downgrade version when needed.

Install FVM

Official doc: Installation

Run:

dart pub global activate fvm

Check:

fvm --version

Fix Flutter version for the project

You can use one of these two ways.

Way 1: Use command

Official doc: Commands Reference

Way 2: Set version in config file

Official doc: Configuration

Create or update:

Content:

After this, the project will follow the exact version you set.

Add to .gitignore

Official doc: Configuration - Git Ignore

To avoid committing cache files, add:

Use FVM in daily Flutter commands

Official doc: Running Flutter

After setup, I always add fvm before Flutter commands:

This makes sure every command runs with the fixed Flutter version.

Setup flow for new teammates

When someone new joins the team, I share this short checklist:

  1. dart pub global activate fvm

  2. fvm use 3.27.4

  3. fvm flutter pub get

  4. fvm flutter run

With this flow, new teammates do not need to guess Flutter version.

Combine FVM with Make for shorter and safer commands

When the project grows, terminal commands become longer. So I combine FVM with Make to group many steps into one short command.

Step 1: Create a Makefile in project root

Example Makefile:

Step 2: Run one command

Without Make, most people need to type:

Result: from 3 lines to 1 line, easier to remember, easier to teach new teammates, and less chance to miss a step.

If you want full details about grouping commands with Make, check this article:

Make

Update + FVM - Version management

Official doc: Commands Reference | Common Workflows | Release In Multiple Channels

When you need a new Flutter version, update with:

Or edit .fvm/fvm_config.json, then run again:

Buy Me a Coffee | Support Me on Ko-fi

Last updated