AFF#8 - FVM: Save A Lot of Headaches with This Tool

No more compile errors when switching projects.

FVM: Save A Lot of Headaches with This Tool

Flutter Version Manager (FVM) is a powerful tool that can save you a lot of headaches when managing your Flutter projects. It's especially useful for developers who work on multiple Flutter projects with different versions of Flutter.

What is FVM?

FVM is a command-line tool that allows you to install and manage multiple Flutter SDK versions on your system. This means that you can have different Flutter versions for different projects, without affecting each other. FVM also makes it easy to switch between Flutter versions, with a single command.

Why I started using it

I remember working on two major projects simultaneously. One was on the latest Flutter stable channel, while the other was a way older project, somethig like 2.12. Before FVM, this was a logistical nightmare. You always had to tediously switch Flutter versions. Sometimes your dependencies were in a weird cached state… Post-FVM? It's like having a smooth sailing ship in what used to be stormy waters.

Why you should use FVM

There are several reasons why you should use FVM for your Flutter projects:

  • Reduces the risk of conflicts. When you have multiple Flutter projects, it can be easy to install different versions of the SDK in the wrong places. This can lead to conflicts and problems with your projects. FVM prevents this by managing all of your Flutter SDK versions in one place.

  • Simplified switching between versions. Switching between Flutter versions can be a hassle, especially if you have multiple projects with different requirements. FVM makes it easy to switch between versions with a single command.

  • Improved development workflow. FVM can help to improve your development workflow by making it easier to manage your Flutter projects. This can save you time and frustration in the long run.

How to install FVM (Mac)

FVM is easy to install. Simply follow these steps:

  1. Open a terminal window.

  2. Run the following commands:

brew tap leoafarias/fvmbrew install fvm

How to use FVM with VSCode

You can add the version symlink for a dynamic switch. VS Code will always use the version selected within the project for all IDE tooling. Also, remove the Flutter SDK from search to make things easier. Just create a folder inside the project called .vscode and then create a file called settings.json and add the following file:

{ "dart.flutterSdkPath": ".fvm/flutter_sdk", // Remove .fvm files from search "search.exclude": { "**/.fvm": true }, // Remove from file watching "files.watcherExclude": { "**/.fvm": true }}

  • Basic commandsFrom now on, you should use your normal Flutter commands via fvm

fvm flutter <version>

  • Install a new Flutter version:

fvm install <version>

FVM: A must-have tool for Flutter developers

FVM is a valuable tool for Flutter developers, especially those who work on multiple projects. It can save you a lot of time and frustration, and make your development workflow more efficient.

Call to action

If you haven't already, I encourage you to try out FVM. It's a powerful tool that can make a big difference in your Flutter development experience.

Overall

FVM is a great tool that can save you a lot of headaches when managing your Flutter projects. It's easy to install and use, and it can help to improve your development workflow. I highly recommend it to all Flutter developers.

Here is a link to the project with all the information you need

https://fvm.app/

Reply

or to participate.