Flutter Version Management: A simple cli to manage Flutter SDK versions.
- Configure Flutter SDK version per project
- Ability to install and cache multiple Flutter SDK Versions
- Easily switch between Flutter channels & versions
- Per project Flutter SDK upgrade
Version Management #
This tool allows you to manage multiple channels and releases, and caches these versions locally, so you don't have to wait for a full setup every time you want to switch versions.
Also, it allows you to grab versions by a specific release, i.e. 1.2.0. In case you have projects in different Flutter SDK versions and do not want to upgrade.
> pub global activate fvm
And then, for information on each command:
> fvm help
Install a SDK Version #
FVM gives you the ability to install many Flutter releases or channels.
> fvm install <version>
Version - use
master to install the Master channel and
1.8.0 to install the release.
Use a SDK Version #
You can use different Flutter SDK versions per project. To do that you have to go into the root of the project and:
> fvm use <version>
Remove a SDK Version #
Using the remove command will uninstall the SDK version locally. This will impact any projects that depend on that version of the SDK.
> fvm remove <version>
List Installed Versions #
List all the versions that are installed on your machine.
> fvm list
Change FVM Cache Directory #
There are some configurations that allows for added flexibility on FVM.
fvm config --cache-path <path-to-use>
List Config Options #
Returns list of all stored options in the config file.
fvm config --ls
Running Flutter SDK #
There are a couple of ways you can interact with the SDK setup in your project.
Proxy Commands #
Flutter command within
fvm proxies all calls to the CLI just changing the SDK to be the local one.
> fvm flutter run
This will run
flutter run command using the local project SDK. If no FVM config is found in the project. FMV will recursively try for a version in a parent directory.
Call Local SDK Directly #
FVM creates a symbolic link within your project called fvm which links to the installed version of the SDK.
> ./fvm run
This will run
flutter run command using the local project SDK.
As an example calling
fvm flutter run is the equivalent of calling
flutter run using the local project SDK.
Configure Your IDE #
Add the following to your settings.json
"dart.flutterSdkPaths": [ "fvm" ]
This project is licensed under the MIT License - see the LICENSE file for details
Contributors ✨ #
Thanks goes to these wonderful people (emoji key):
📖 🤔 💻 💡 👀 🚧 🚇
This project follows the all-contributors specification. Contributions of any kind welcome!
- Better Flutter command compatibility
- Improved error logging and --verbose behavior
- Friendlier error messages
- Better Error handling and friendlier error message
- Project clean-up and tweaks for better pub analysis.
- Initial stable version rewritten in Dart.
The following is a step by step if you want to run an specific version of Flutter within a project.
First choose the version you would like to install and cache on your machine.
This will install version 1.8.0 and cache locally.
> fvm install 1.8.0
Go into the project directory
> cd path/to/project
Set the project to use the version that you have installed.
> fvm use 1.8.0
Use this package as an executable
1. Install it
You can install the package from the command line:
$ pub global activate fvm
2. Use it
The package has the following executables:
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: fvm: ^0.6.6
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.13.1+4
lib/fvm.dart. (-1 points)
lib/fvm.dart reported 2 hints:
line 2 col 8: Unused import: 'package:args/command_runner.dart'.
line 11 col 8: Unused import: 'package:cli_util/cli_logging.dart'.
dartfmt to format
The package description is too short. (-4 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
|Dart SDK||>=2.5.0 <3.0.0|