Flutter 2025 Roadmap: Key Performance, AI, and Accessibility Enhancements
Stay updated with the latest content!
Somnio Software Logo
Services
OverviewFull Product DevelopmentProduct DiscoveryStaff Augmentation
About
CompanyFlutter ExpertisePress & NewsCareers
Our work
Industries
Fintech
Healthcare
Education
Fashion
Media & Entertainment
Retail & Ecommerce
Other
Success Cases
Pronti
Pronti
ProWallet
ProWallet
Jaac
Jaac
Meet
Meet
bonnee
bonnee
Aqilis
Aqilis
View all
Resources
Open SourceTutorials & TalksDownloadables
Somnio Solutions
OverviewE-commerceNews
Blog
Let’s talk

A guide to handling different Flutter SDK versions

Introducing Flutter Version Management (FVM), a tool that allows you to have multiple Flutter SDK versions and use them per project.

A guide to handling different Flutter SDK versions
Authors
Hairon Chaviano
Hairon Chaviano
Software Developer
Technical
N
min read
/
August 4, 2022
Share
Copy post url
linkedin
Facebook
Twitter

As Flutter Developers, we often face situations where we have multiple projects that use different versions of the SDK. At this point, millions of questions arise: Should I upgrade all projects? Am I wondering if all my packages support that version? Will I break the projects? Is it essential to upgrade all my projects to the latest version?

Answering these questions depends greatly on the context, which is why I'd like to introduce you to a tool that can help you.

Flutter Version Management to the rescue!

Flutter Version Management (FVM) is a tool that allows you to have multiple Flutter SDK versions installed and use them per project. Using this tool, you’ll be able to run any project using any Flutter SDK version.

Flutter Version Management Installation process

Now we know FVM and what it can do for us, let’s see how to install it.

MacOS and Linux:

Install:

brew tap leoafarias/fvm

brew install fvm

Uninstall:

brew uninstall fvm

brew untap leoafarias/fvm

Activate:

dart pub global activate fvm

Windows:

Install:

choco install fvm

Activate:

dart pub global activate fvm

Now we have the FVM installed, you probably want to add it to the .gitignore file in order to avoid upload unnecessary files to your repo, so to do that add the following paths to your .gitignore: .fvm/flutter_sdk

.fvm/fvm_config.json

Using Flutter Version Management on my project

Once the FVM is ready to use, we need to set the Flutter SDK version that we want to use for the project. You need to move to your project /lib path using the terminal and write the command:

fvm use <flutter_sdk_version>

I really recommend,  based on my and my teammates experiences, quitting your code editor or IDE after setting the Flutter SDK version just to avoid conflicts with previous versions.

And that’s all, folks! Now every Flutter command that you need to execute you’ll need to add fvm word at the beginning, e.g: fvm flutter pub get.

flutter run vs fvm flutter run

Flutter Version Management Useful commands

Here I share a list of useful commands:

  1. List of installed versions: fvm list
  2. Change version: fvm use <new_sdk_version>
  3. Install version: fvm install <new_sdk_version>
  4. Remove version: fvm remove <flutter_sdk_version>
  5. List of available releases to install: fvm releases

Configure global version for Flutter Version Management

Are you the kind of person that hate writing fvm on each Flutter command?

Don’t worry. All you need to do is configure the global version. By doing this, you can have the default Flutter version in your machine, but keep the dynamic switching. It allows you not to make any changes on how you currently use Flutter, but with faster switching and version caching.

To accomplish this, you’ll need to run the following command:

fvm global <flutter_sdk_version>

After this step, you don’t need to use fvm word more on your Flutter commands… just to change the Flutter SDK version :)

Using Flutter Version Management with flavors

You can also use different Flutter SDK versions for different project environments or release type better knows as flavors, let’s see how to configure the flavors for FVM.

Go to the .fvm/fvm_config.json path and by default you will see something like this:

Now you only need to add your flavors inside the “flavors” object like this:

More useful commands… for flavors
  1. To choose a specific version for a flavor: fvm use <new_sdk_version> --flavor <flavor_name>
  2. To switch between flavors: fvm flavor <flavor_name>
  3. To see the list of flavors: fvm flavor

Conclusions on Flutter Version Management

For us (Flutter developers), FVM comes in handy. In general, it is always recommended to keep your project updated if you are involved in several projects or want to use a different SDK version than the one you already have. However, there are times when you can't do it, and using FVM is the best way to avoid the questions we already asked at the beginning.

Contact us

Stay in the loop!

Receive tech news, software tips, and business insights.
Subscribe to our newsletter!

Thank you! Your submission has been received!
Oops! Something went wrong.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Read next

Business

How Flutter is Transforming MedTech: Cross-Platform Development for Healthcare Apps

Read more
How Flutter is Transforming MedTech: Cross-Platform Development for Healthcare Apps
Read more
Announcements

Somnio Software: Premier Verified Company on Clutch and Global Award-Winning Leader

Read more
Somnio Software: Premier Verified Company on Clutch and Global Award-Winning Leader
Read more
Somnio Software Logo
Services
Full Product DevelopmentProduct DiscoveryStaff Augmentation
Our work
IndustriesFintechHealthcareEducationEntertainmentSuccess Cases
About
CompanyFlutter ExpertiseCareersPress & NewsPrivacy PolicyCompany Presentation Brochure
Resources
Open SourceTutorials & TalksDownloadablesBlog
Office
José Ellauri 1142
Montevideo, Uruguay
11300
Contact
hello@somniosoftware.comjobs@somniosoftware.com
(+598) 98 168 142 - Uruguay+1 (786) 726‑1751 - US
Clutch Award Top B2B Company 2022
Clutch Award Top B2B Company 2022Clutch Award Top B2B Company 2022Clutch Award Top B2B Company 2022Clutch Award Top B2B Company 2023Clutch Award Top B2B Company 2023Clutch Award Top B2B Company 2023Clutch Award Top B2B Company 2023Clutch Award Top B2B Company 2022The Manifest Award Top Flutter Developers 2021Clutch Award Top 1000 Companies Global 2022Clutch Award Top B2B Company 2023