I have 2 versions of flutter 1 is latest another is previous, I want to create a 'flutterl' alias for cmd in windows for latest one and 'flutter' for previous one. how to create it ?
I have 2 versions of flutter 1 is latest another is previous, I want to create a 'flutterl' alias for cmd in windows for latest one and 'flutter' for previous one. how to create it ?
It is very simple to do just follow these steps:
In my case i will be using 2 different commands like flutter for current flutter version and flutterl for latest flutter version.
To create a new alias in windows you should create a new folder. here i have created Aliases, you can create this folder in C directory or wherever you want.
In this folder create a new file flutterl.bat
And right click and edit this file add the following code
@echo off
C:\src\flutter_latest\bin\flutter %*
Here C:\src\flutter_latest is the location, which contain's flutter latest version.
Then goto Environment variables and in the path add this files location. To do this you can follow these steps
Same Steps with visuals
Now you are good to go. Both flutter and flutterl will be working fine to test then run
flutter doctor
flutterl doctor
If you want to manage the flutter versions for your project only then you can use fvm package, it is a simple cli to manage Flutter SDK versions.
Flutter Version Management
You will have to use Flutter Version Manager - FVM https://github.com/leoafarias/fvm
Flutter Version Management: A simple CLI & GUI to manage Flutter SDK versions.
FVM helps with the need for a consistent app builds by allowing to reference Flutter SDK version used on a per-project basis. It also allows you to have multiple Flutter versions installed to quickly validate and test upcoming Flutter releases with your apps, without waiting for Flutter installation every time.
Create a hard link to one
MKLINK /H "C:\Path\for\link\flutterl.exe" "c:\path\to\latest\version\flutter.exe"