Eleandro Duzentos
Eleandro Duzentos

Reputation: 1558

How to use both Flutter stable and dev SDK on the same machine?

I'm working with Flutter to make a Mobile App using the stable Flutter SDK release. But I also want to try Flutter Desktop and Flutter Web that are not part of the Flutter stable channel yet, but are present on the Flutter dev channel.

My question is... How can I try Flutter Desktop and Flutter Web without override the Flutter stable release on my machine?

Upvotes: 13

Views: 5443

Answers (3)

Eleandro Duzentos
Eleandro Duzentos

Reputation: 1558

I found this Dart package called Flutter Version Management that does exactly what I want.

As the docs says:

Flutter Version Management: A simple cli to manage Flutter SDK versions.

Features:

  • Configure and use Flutter SDK version per project
  • Ability to install and cache multiple Flutter SDK Versions
  • Fast switch between Flutter channels & versions
  • Dynamic SDK paths for IDE debugging support.
  • Version FVM config with a project for consistency across teams and CI environments.
  • Set global Flutter version across projects

https://github.com/leoafarias/fvm

Now I just need to add FVM_HOME/default/bin to the PATH and FVM will take care of everything...

Upvotes: 5

Genes
Genes

Reputation: 298

Two solutions

  1. Put the installation files in two different directories one with stable and the other dev and add one of them to the path then you can change the path variable when needed to use the other channel.

  2. Put the flutter repository file in two different directories one with stable and the other with dev then, add the first installation to the path then add an alias to point to the second installation directory.

Upvotes: 2

Miguel Ruivo
Miguel Ruivo

Reputation: 17756

You'll need to setup alias to switch between different environments easily.

See here a detailed article for that.

Upvotes: 9

Related Questions