I’m working on several little projects and some of them require different versions of packages and versions of dart flutter. Create virtual environment similar to python?
you can use tow method
If you're using VSCode, you can download multiple version of flutter SDK into different path and quickly switch between them using Dart&Flutter Plugin
as followin You need to have two flutter SDK folders. One of them you need to rename it to flutter_beta (or whatever you like, I called it that way because on that one I am always on beta channel and in the original one I am always on stable channel). Then, inside that flutter_beta folder you need to go to bin folder and rename the flutter file to flutterbeta (or whatever you want) Then you need to export the path of that new executable like you did to the first one https://flutter.dev/docs/get-started/install/linux#update-your-path And that's all, the VSCode settings.json configuration is optional... reference1
or
In case you have projects in different Flutter SDK versions and do not want to upgrade.
https://github.com/leoafarias/fvm
https://www.youtube.com/watch?v=R6vKde1vIGQ
dart pub global activate fvm
fvm
and chose the version you will use its sdk
notes:You must add the path to the fvm executable to the $PATH environment variable. After running "pub global activate fvm" reference
This package can help you to have multiple Flutter environments on one machine and change them depending on the project you're working on (Like python virtual environments).
https://github.com/lukeurban/flenv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With