■ はじめに
説明
Flutter のバージョン管理をする為に FVM (Flutter Version Management) というものがある。
Aプロジェクトでは 3.19、Bプロジェクトでは 3.22、など違うバージョンで管理したい時など切り替えて使える。
以降は、導入手順と簡単な使い方について解説。
環境
- Mac
% sw_vers
ProductName: macOS
ProductVersion: 14.3.1
BuildVersion: 23D60
%
■ 手順
1. インストール手順
1.1 Dart のリポジトリを brew で登録する。
- コマンド
% brew tap dart-lang/dart
- 実行結果
% brew tap dart-lang/dart
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:49847c7a13f7094b211f6d0025900dd23716be07dac894a3d6941d7696296306
######################################################################################################################################################################################################### 100.0%
==> Pouring portable-ruby-3.3.3.arm64_big_sur.bottle.tar.gz
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
age-plugin-se ansible@9 asak dnsgen ecs-deploy nsync pulsarctl tinymist
==> New Casks
font-alumni-sans-sc font-maname font-palemonasmufi-bolditalic font-palemonasmufi-regular impel tella
font-beiruti font-palemonasmufi-bold font-palemonasmufi-italic getoutline loop
You have 1 outdated formula installed.
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
remote: Enumerating objects: 4394, done.
remote: Counting objects: 100% (2148/2148), done.
remote: Compressing objects: 100% (446/446), done.
remote: Total 4394 (delta 1856), reused 1923 (delta 1679), pack-reused 2246
Receiving objects: 100% (4394/4394), 770.98 KiB | 14.28 MiB/s, done.
Resolving deltas: 100% (3132/3132), done.
Tapped 52 formulae (87 files, 1MB).
%
1.2 Dart SDK のインストール
- コマンド
% brew install dar
- 実行結果
% brew install dar
==> Downloading https://ghcr.io/v2/homebrew/core/dar/manifests/2.7.14
######################################################################################################################################################################################################### 100.0%
==> Fetching dependencies for dar: argon2, gettext, libgpg-error, libgcrypt and lzo
==> Downloading https://ghcr.io/v2/homebrew/core/argon2/manifests/20190702_1
######################################################################################################################################################################################################### 100.0%
==> Fetching argon2
==> Downloading https://ghcr.io/v2/homebrew/core/argon2/blobs/sha256:c503692d2a7d5538d5cb241b69c283d998bde91b38e3065c01bc79fdbe8cd197
######################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gettext/manifests/0.22.5
######################################################################################################################################################################################################### 100.0%
==> Fetching gettext
==> Downloading https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:4b5b6cb0692b4606b9220fcbc9da3ab546234348dc87ef8033830e22c4c7bdb1
######################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libgpg-error/manifests/1.49
######################################################################################################################################################################################################### 100.0%
==> Fetching libgpg-error
==> Downloading https://ghcr.io/v2/homebrew/core/libgpg-error/blobs/sha256:7473b0f8035b06d01bd0770e830f194d9b96eb0b42071fde9fd8275a6c62439b
######################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libgcrypt/manifests/1.10.3
######################################################################################################################################################################################################### 100.0%
==> Fetching libgcrypt
==> Downloading https://ghcr.io/v2/homebrew/core/libgcrypt/blobs/sha256:4cb7e27bd6c2531421aff6abe9a232ec6b6b074d70661ae2b2131992bea42845
######################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/lzo/manifests/2.10
######################################################################################################################################################################################################### 100.0%
==> Fetching lzo
==> Downloading https://ghcr.io/v2/homebrew/core/lzo/blobs/sha256:167749edd2052e4c577f27c79a41eb1cb4b79302b1e4bef1e4cfb29bd50aedd9
######################################################################################################################################################################################################### 100.0%
==> Fetching dar
==> Downloading https://ghcr.io/v2/homebrew/core/dar/blobs/sha256:31156786fa7a095921cdc62daf456468b6345054ff8eb0e9db8f332dd4eced13
######################################################################################################################################################################################################### 100.0%
==> Installing dependencies for dar: argon2, gettext, libgpg-error, libgcrypt and lzo
==> Installing dar dependency: argon2
==> Downloading https://ghcr.io/v2/homebrew/core/argon2/manifests/20190702_1
Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/1edde14bdb96d4a110df174fb14e59db91750d4b8d4834474e62450ae1ec81a5--argon2-20190702_1.bottle_manifest.json
==> Pouring argon2--20190702_1.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/argon2/20190702_1: 13 files, 688.6KB
==> Installing dar dependency: gettext
==> Downloading https://ghcr.io/v2/homebrew/core/gettext/manifests/0.22.5
Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/447e45b77bb47ede0377f7eab1863825298ecaaaeed0bbd84aca3bd300b00508--gettext-0.22.5.bottle_manifest.json
==> Pouring gettext--0.22.5.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/gettext/0.22.5: 2,044 files, 24.4MB
==> Installing dar dependency: libgpg-error
==> Downloading https://ghcr.io/v2/homebrew/core/libgpg-error/manifests/1.49
Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/fc35de478622650aca14d8c717ef01e2f6782f71c200739cc88435d236f6d5bf--libgpg-error-1.49.bottle_manifest.json
==> Pouring libgpg-error--1.49.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libgpg-error/1.49: 50 files, 1.7MB
==> Installing dar dependency: libgcrypt
==> Downloading https://ghcr.io/v2/homebrew/core/libgcrypt/manifests/1.10.3
Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/51a9d782e7010eccf6d60ff8e69c811398480eb544aec8866787a22cda36fccd--libgcrypt-1.10.3.bottle_manifest.json
==> Pouring libgcrypt--1.10.3.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libgcrypt/1.10.3: 24 files, 3.3MB
==> Installing dar dependency: lzo
==> Downloading https://ghcr.io/v2/homebrew/core/lzo/manifests/2.10
Already downloaded: /Users/username/Library/Caches/Homebrew/downloads/d4aa5b0c239912c53bc857d1012c6b7feb4acb509618f5e100f95bf8521f08e7--lzo-2.10.bottle_manifest.json
==> Pouring lzo--2.10.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/lzo/2.10: 32 files, 568KB
==> Installing dar
==> Pouring dar--2.7.14.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/dar/2.7.14: 176 files, 11.0MB
==> Running `brew cleanup dar`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
%
1.3 pub を使って fvm をインストール
- コマンド
% dart pub global activate fvm
- 実行結果
% dart pub global activate fvm
+ args 2.5.0pendencies... (1.4s)
+ async 2.11.0
+ boolean_selector 2.1.1
+ characters 1.3.0
+ cli_completion 0.5.0
+ clock 1.1.1
+ collection 1.18.0 (1.19.0 available)
+ dart_console 1.2.0 (4.1.0 available)
+ dart_mappable 4.2.2
+ date_format 2.0.7
+ equatable 2.0.5
+ ffi 2.1.2
+ file 7.0.0
+ fvm 3.1.7
+ git 2.2.1 (2.3.0 available)
+ http 1.2.1
+ http_parser 4.0.2 (4.1.0 available)
+ interact 2.2.0
+ intl 0.18.1 (0.19.0 available)
+ io 1.0.4
+ json_annotation 4.9.0
+ jsonc 0.0.3
+ mason_logger 0.2.15
+ matcher 0.12.16+1
+ meta 1.15.0
+ path 1.9.0
+ platform 3.1.5
+ process 5.0.2
+ pub_semver 2.1.4
+ pub_updater 0.4.0
+ pubspec 2.3.0
+ quiver 3.2.1
+ scope 4.1.0
+ source_span 1.10.0
+ stack_trace 1.11.1
+ stream_channel 2.1.2
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test_api 0.7.2
+ tint 2.0.1
+ type_plus 2.1.1
+ typed_data 1.3.2
+ uri 1.0.0
+ web 0.5.1
+ win32 5.5.0 (5.5.1 available)
+ yaml 3.1.2
Building package executables...
Built fvm:compile.
Built fvm:main.
Installed executable fvm.
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
export PATH="$PATH":"$HOME/.pub-cache/bin"
Activated fvm 3.1.7.
%
1.4 パスを通す
- コマンド
% export PATH="$PATH":"$HOME/.pub-cache/bin"
- 実行結果
% export PATH="$PATH":"$HOME/.pub-cache/bin"
%
1.5 バージョンを確認し、fvm コマンドが使える事を確認する。(パスが通っていればバージョンが表示される)
- コマンド
% fvm --version
- 実行結果
% fvm --version
3.1.7
%
1.6 Flutter SDK のキャッシュディレクトリのパスを設定する。
デフォルトだとホームディレクトリに fvm フォルダが出来る。
ホームディレクトリ → flutter というフォルダの中に格納した方が一元管理出来る為、下記の設定を実施。
- コマンド
% fvm config --cache-path "/Users/username/flutter/fvm"
- 実行結果
% fvm config --cache-path "/Users/username/flutter/fvm"
Setting cache-path to: /Users/username/flutter/fvm
AppConfig(disableUpdateCheck: null, lastUpdateCheck: null, cachePath: /Users/username/flutter/fvm, useGitCache: null, gitCachePath: null, flutterUrl: null, priviledgedAccess: null, runPubGetOnSdkChanges: null, updateVscodeSettings: null, updateGitIgnore: null)
✓ Settings saved. (10ms)
%
1.7 変更を適用する。
- コマンド
% source ~/.zshrc
- 実行結果
% source ~/.zshrc
%
2. 使い方
releases されているバージョンを確認する時に使う。(stable とは安定版という意味)
- コマンド
$ fvm releases
- 実行結果
% fvm releases
Completion files installed. To enable completion, run the following command in your shell:
source /Users/username/.zshrc
┌───────────────────┬──────────────┬──────────┐
│ Version │ Release Date │ Channel │
├───────────────────┼──────────────┼──────────┤
│ v1.0.0 │ Dec 4, 2018 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.2.1 │ Feb 26, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.5.4-hotfix.2 │ May 7, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.2 │ Jul 8, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.3 │ Jul 9, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.7.8+hotfix.4 │ Jul 24, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.2 │ Sep 22, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.4 │ Oct 1, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.5 │ Oct 17, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.9.1+hotfix.6 │ Oct 23, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.5 │ Dec 11, 2019 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.7 │ Jan 27, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.8 │ Feb 11, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ v1.12.13+hotfix.9 │ Apr 17, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.0 │ May 6, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.1 │ May 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.2 │ May 28, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.3 │ Jun 4, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.4 │ Jun 18, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.17.5 │ Jul 1, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.0 │ Aug 5, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.1 │ Aug 6, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.2 │ Aug 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.3 │ Sep 2, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.20.4 │ Sep 15, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.0 │ Oct 1, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.1 │ Oct 8, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.2 │ Oct 16, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.3 │ Oct 30, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.4 │ Nov 13, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.5 │ Dec 10, 2020 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 1.22.6 │ Jan 25, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.0 │ Mar 3, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.1 │ Mar 4, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.2 │ Mar 12, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.3 │ Mar 19, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.4 │ Apr 2, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.5 │ Apr 16, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.0.6 │ Apr 30, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.0 │ May 18, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.1 │ May 27, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.2 │ Jun 11, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.2.3 │ Jul 1, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.0 │ Sep 8, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.1 │ Sep 17, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.2 │ Sep 30, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.5.3 │ Oct 15, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.8.0 │ Dec 9, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.8.1 │ Dec 16, 2021 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.0 │ Feb 3, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.1 │ Feb 10, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.2 │ Feb 19, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.3 │ Mar 3, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.4 │ Mar 28, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 2.10.5 │ Apr 18, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.0 │ May 11, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.1 │ May 20, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.2 │ Jun 10, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.3 │ Jun 22, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.4 │ Jul 1, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.0.5 │ Jul 13, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.0 │ Aug 30, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.1 │ Sep 7, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.2 │ Sep 14, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.3 │ Sep 28, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.4 │ Oct 5, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.5 │ Oct 19, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.6 │ Oct 26, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.7 │ Nov 2, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.8 │ Nov 9, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.9 │ Nov 23, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.3.10 │ Dec 15, 2022 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.0 │ Jan 24, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.1 │ Feb 1, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.2 │ Feb 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.3 │ Feb 9, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.4 │ Feb 21, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.5 │ Feb 23, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.6 │ Mar 1, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.7 │ Mar 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.8 │ Mar 22, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.9 │ Mar 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.10 │ Apr 5, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.11 │ Apr 12, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.7.12 │ Apr 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.0 │ May 10, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.1 │ May 17, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.2 │ May 24, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.3 │ Jun 2, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.4 │ Jun 7, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.5 │ Jun 14, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.10.6 │ Jul 12, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.0 │ Aug 16, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.1 │ Aug 23, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.2 │ Aug 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 8, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.3 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.4 │ Sep 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.5 │ Sep 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.6 │ Sep 27, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.7 │ Oct 11, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.8 │ Oct 18, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.13.9 │ Oct 25, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.0 │ Nov 15, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.1 │ Nov 27, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.2 │ Nov 30, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.3 │ Dec 6, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.4 │ Dec 13, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.5 │ Dec 20, 2023 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.6 │ Jan 10, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.7 │ Jan 11, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.8 │ Jan 17, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.16.9 │ Jan 25, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.0 │ Feb 15, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.1 │ Feb 21, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.2 │ Feb 28, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.3 │ Mar 8, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.4 │ Mar 21, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.5 │ Mar 28, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.19.6 │ Apr 17, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.0 │ May 13, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.1 │ May 22, 2024 │ stable │
├───────────────────┼──────────────┼──────────┤
│ 3.22.2 │ Jun 6, 2024 │ stable ✓ │
└───────────────────┴──────────────┴──────────┘
%
特定のバージョンをインストールする時に使う。
- コマンド
% fvm install <Version>
- 実行結果
% fvm install 3.22.0
✓ Flutter SDK: SDK Version : 3.22.0 installed! (2.5s)
%
使用するバージョンを選択する時に使う。
- コマンド
% fvm use <Version>
- 実行結果
% fvm use 3.22.0
Setting up Flutter SDK: 3.22.0
Downloading Darwin arm64 Dart SDK from Flutter engine f6344b75dcf861d8bf1f1322780b8811f982e31a...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 219M 100 219M 0 0 18.7M 0 0:00:11 0:00:11 --:--:-- 22.7M
Building flutter tool...
Resolving dependencies...
Downloading packages...
Got dependencies.
Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5dcb86f68f (6 weeks ago) • 2024-05-09 07:39:20 -0500
Engine • revision f6344b75dc
Tools • Dart 3.4.0 • DevTools 2.34.3
✓ Flutter SDK: SDK Version : 3.22.0 is setup
Skipping "pub get" because no pubspec.yaml found.
✓ Project now uses Flutter SDK : SDK Version : 3.22.0
%
インストール済みのバージョンを表示する時に使う。
- コマンド
$ fvm list
- 実行結果
% fvm list
Cache directory: /Users/username/flutter/fvm/versions
Directory Size: 1.47 GB
┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┬───────┐
│ Version │ Channel │ Flutter Version │ Dart Version │ Release Date │ Global │ Local │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.22.0 │ stable │ 3.22.0 │ 3.4.0 │ May 13, 2024 │ │ ● │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.19.0 │ stable │ 3.19.0 │ 3.3.0 │ Feb 15, 2024 │ │ │
└─────────┴─────────┴─────────────────┴──────────────┴──────────────┴────────┴───────┘
%
現在設定されているバージョンを確認する時に使う。
- コマンド
$ fvm flutter --version
- 実行結果
% fvm flutter --version
Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5dcb86f68f (6 weeks ago) • 2024-05-09 07:39:20 -0500
Engine • revision f6344b75dc
Tools • Dart 3.4.0 • DevTools 2.34.3
%
3. IDE への設定
- AndroidStudio
新規プロジェクトを作成する時はここから対象のバージョン(パス)を選択する。
既存のプロジェクトの場合は、「設定 → 言語とフレームーク → Flutter」の中にある SDK から対象のバージョン(パス)を選択する。
- VSCode
VSCode の設定は下記の記事を参考にしていただればと!
以上。
■ 参考文献