Perfect guide install fvm Flutter version manager

FVM – Flutter Version Management is great tool for developer who using Flutter building amazing mobile applications.

Features:
– Ability to manage and cache multiple Flutter SDK Versions. Fast switching between channels & releases. View available channels & releases.
– Configure and use Flutter SDK version per project. Dynamic SDK paths for IDE debugging support. Allows for consistency across teams and CI environments.
– Manage global Flutter SDK version. Spawn processes in any Flutter SDK version. Docker images for CI & dev workflow. Install Flutter from specific commits.

Before install

With Windows users, you need enable Create symbolic links for your computer user:

  • Start Edit group policy
  • Open Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment
  • Scroll down find Create symbolic links and double click > Add User or Group
  • Advanced > Find Now > Select your computer user > OK > OK > OK

Install fvm Flutter version manager

First of all, you Don’t need to delete your current Flutter, so just go install fvm without uninstall anything!

  • Download latest Releases ยท fluttertools/fvm (github.com) for your computer. (example: fvm-2.4.1-windows-x64.zip)
  • Extract fvm folder inside downloaded file to C:\Development\

  • Start Edit the system environment variables > Environment Variables
    – Add new Variable name FVM_HOME with value is Full fvm folder location extracted C:\Development\fvm
    – Scroll down find Variable Path to edit and add new 2 follows:
    %FVM_HOME%
    %FVM_HOME%\default
    If you already install Flutter before Don’t forget to remove old Flutter bin location in Path variable.

  • Done! fvm now installed, you can check version by open new Terminal and run
    fvm -h
    fvm --version

Install Flutter through fvm

You now can install Flutter multiple versions easy!

If already installed Flutter before, you can move/copy whole Flutter folder to inside C:\Development\fvm\version\ then change folder name to [flutter version] (example: C:\Development\fvm\versions\2.10.5 if your old Flutter version is 2.10.5).
By this way, later you can use old Flutter without download many pub cached packages (save internet bandwidth!)

For install multiple Flutter version you can do follow:

  • Open Terminal and run:
    fvm releases
    It will list all current Flutter release with released date.
  • Now just install version you want! (example: 3.0.5) You also can use version channel like dev, stable, beta to install current version of this channel!
    fvm install 3.0.5
    or
    fvm install 2.10.5
    fvm install stable
  • After install Flutter version, you can list by run:
    fvm list
  • Now you need select Default (Global) Flutter version you want to use most time. This version will be use default when you run command fvm flutter, fvm dart (It will create symbolic link folder fvm\default)
    fvm global stable
    or
    fvm global 3.0.5
  • All done! Now you can run Flutter and Dart:
    fvm flutter doctor
    fvm dart --version
    It will use Global version.

Create terminal alias flutter dart command

You see. Default need to run fvm flutter, fvm dart. Longgggg! We need create alias flutter dart command shorter and standard!

Windows users download fvm_flutter_dart.zip then extract all file inside to C:\Development\fvm\ folder.
Done! You can start using command flutter, dart. Supported both Windows Terminal/Cmd and Gitbash for Windows.

flutter --version
dart --version

Use special Flutter version inside special folder

fvm will use nearest config (inside .fvm folder) for detect what Flutter version it should use.
Current folder > Parent folder > Global
(if current/parent working folder don’t have config it will use Global version)

Example Global is stable (3.0.5) but in special project Amazing you want to use Flutter version 2.10.5 then run follow:

cd C:\Projects\Amazing
fvm use 2.10.5
flutter --version

It will create folder C:\Projects\Amazing\.fvm with config files and use Flutter 2.10.5 version when run flutter/dart command inside Amazing folder.

Leave a Reply

Your email address will not be published.