Version Management In Flutter
By: Naveen Srivastava
Tags: Flutter, Dart, Mobile App Development, Version Management, Flutter App Development

Flutter Version Management (FVM):

When we work on our flutter project, we need to release the updated flutter and the app, verify it, and switch different types of SDK to test it, which takes us time for development. To avoid this, we use Flutter Version Management, which provides us with different types of Flutter versions for our machines. So that each time Flutter can test the app against the updated Flutter release without waiting for installation and will be able to switch to the Flutter version accordingly.

FVM Install:

First of all, we need to make sure that flutter is already installed and whether the flutter is the stable channel. if not then Type the below code in your command line.

// set flutter to stable channel

flutter channel stable // check flutter channel

flutter channel // output

Flutter channels:

master

dev

beta

* stable

After this, we have to determine whether our flutter is already installed or not, if not then first we will install FVM.

$ pub global activate fvm

We will now see that some warnings are given at the end of the installation process, so we need to add the fvm path to the shell configuration file (.bashrc, bash_profile, etc.) before taking the next step

export PATH=”$PATH:`pwd`/flutter/bin”$ fvm install

export PATH=”$PATH:`pwd`/bin/cache/dart-sdk/bin”

export PATH=”$PATH:`pwd`/.pub-cache/bin”

SDK Version lnstall:

DVM allows us to install multiple types of flutter release or channels To install the channel use stable and to install the release version of flutter we will use v2.0.5 or 1.17.0-dev.3.1 and as soon as we run — skip-setup after that it will skip the setup

$ fvm install stable or fvm install 2.0.5

Project Config SDK Version:

After that, we will see that Whether the project is configured to use a specific version or not, if not, we will install it on the appropriate version without arguments.

$ fvm install

Flutter Installed Versions List:

Now by typing in the following command we can list the installed version on our machine by using the below command FVM will store the SDK version.

$ fvm list

Upgrade SDK Version:

Using upgrade SDK version command when we need to upgrade our current SDK version so you have to call command of your flutter SDK as in normal flutter installation.

$ fvm flutter upgrade

Set Up IDE:

Now we will see how to configure IDE, below we have shown how to configure in the android studio and vs code let’s see it now.

=> Android Studio:

In Your root project directory copy the absolute following symbolic link.

Example: /absolute/path-to-your-project/.fvm/flutter_sdk

After that we will open Languages ​​and Frameworks in the menu of Android Studio -> Now search for flutter or flutter and change the path to flutter SDK. and implement the change. Now you can run it with selected versions of flutter and debug it. If you want to see the new setting made then we can use Android Studio will restart again.

=> VS Code:

Now we will configure VS Code here we will see how to complete the VS Code process.

We can see all the installed versions by FVM in the code by providing the path to the flutter SDK version directory.

After that press, Cmd + then go to Settings.json and paste the below path.

"dart.flutterSdkPaths": ["$YOUR_PATH/fvm/versions",],

To get the above path we will execute the fvm list command.

// copy this path

Versions path: $YOUR_PATH/fvm/versions

After that type cmd + shift + p to use the sdk and type change sdk now and now you can choose your preferred version.

Conclusion:

In this article, I have explained Version Management in a flutter, which you can modify and experiment with according to your own, this little introduction was from the Version Management In Flutter.

I hope this blog will provide you with sufficient information on Trying up the Version Management In Flutter. We showed you the Explore Version Management In Flutter and worked on it in your flutter applications, So please try it.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.