How to create Multiple Flutter version Aliases to use in command prompt in Windows PC separately
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
- Right click on this pc, and click on properties
- Click on Advanced Settings
- Then click on Environment Variables
- Edit Path
- Click on new and paste the Location of Aliases folder, that you've created
Same Steps with visuals
- Right click on this pc, and click on properties
- Click on Advanced Settings
- Then click on Environment Variables
- Edit Path
- Click on new and paste the Location of Aliases folder, that you've created
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
Rishabh Bhardwaj
Updated on December 25, 2022Comments
-
Rishabh Bhardwaj over 1 year
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 ?