fvm
fvm copied to clipboard
[Feature Request] Be able to run the same app with two different versions of flutter at the same time
Is your feature request related to a problem? Please describe. When creating packages/plugins for Flutter, sometimes they break on Flutter updates. It's, sometimes, hard to debug and perform the changes necessary to be able to keep the backwards-compatibility with older Flutter versions.
Describe the solution you'd like
Being able to run the same app with two different versions of Flutter at the same time, with some kind of command like:
fvm run mutliple --windows 2.10.0 --windows 3.0.0
(devices + version)
The command above would run two windows of an app at the same time.
Additionally, this wouldn't work on certains devices simuntaneously, such as mobile (Android and iOS), because there is no way to open two apps and display it on the screen. Although, a --windows
and a iPhone
would work.
Describe alternatives you've considered
Running flutter run -d all
, but that doesn't let me choose the version I want to use
Additional context
The latest Flutter release 3.0.0 broke several packages/plugins because of WidgetsBinding.instance
is no longer nullable. Most of the devs used to use WidgetsBinding.instance!
(!
marks it as non-nullable), but when we remove the !
from the code, the package becomes incompatible with older versions. It took a while for me to realize I had broken those apps that are using old versions of Flutter and were using my packages, so the solution was to revert the changes and change !
to ?
to keep the backwards-compatibility (and also add a flag).
@bdlukaa fvm has a command that does not run in multiple but does spawns a process in a defined version. Check it out if this helps https://fvm.app/docs/guides/running_flutter#spawn-command
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.