This is the 24th day of my participation in the August More Text Challenge. For the Nuggets’ August challenge,

The Choco is installed first for Flutter version control

If you can’t run as powerShell administrator, open a PowerShell window, right click on the taskbar, and select the first one to enter

image-20210726214610912

Type the command

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Copy the code

The installation is successful.

After installing FVM, consider setting the environment variable FVM_HOME or FVM_GIT_CACHE. Otherwise, the default path to install the FLUTTER SDK cache is ~/ FVM /versions.

fvm releases

fvm releases: View all Flutter SDK releases available for install.

List the flutter SDK distributions available remotely.

Microsoft Windows [Version10.019042.1165.[c] Microsoft Corporation. All rights reserved.C:\Users\85285>fvmlist
'fvmlist'Not internal or external commands, not runnable programs or batch files.C:\Users\85285>fvm list

No SDKs have been installed yet. Flutter. SDKs installed outside of fvm will not be displayed.


C:\Users\85285>fvm releases
Feb 27 18│ where v01.6.
Mar 6 18│ where v01.8.
Mar 7 18│ where v01.9.
Mar 7 18│ where v02.. 0
Mar 12 18│ where v02.1.
Mar 13 18│ where v01.. 5
Mar 16 18│ where v02.2.
Mar 20 18│ where v02.3.
Mar 26 18│ where v02.4.
Mar 30 18│ where v02.. 5
Mar 30 18│ where v02.6.
Apr 2 18│ where v02.7.
Apr 2 18│ where v02.3.
Apr 3 18│ where v02.8.
Apr 5 18│ where v02.9.
Apr 9 18│ where v02.8.
Apr 9 18│ where v02.10.
Apr 12 18│ where v02.11.
Apr 16 18│ where v03.. 0
Apr 20 18│ where v03.1.
Apr 20 18│ where v03.2.
Apr 23 18│ where v03.3.
Apr 24 18│ where v03.4.
Apr 25 18│ where v03.. 5
May 2 18│ where v03.1.
May 4 18│ where v03.6.
May 7 18│ where v03.2.
May 7 18│ where v04.. 0
May 9 18│ where v04.1.
May 9 18│ where v04.2.
May 11 18│ where v04.3.
May 14 18│ where v04.4.
May 22 18│ where v04.4.
May 29 18│ where v0. 5. 0
May 30 18│ where v0. 51.
Jun 8 18│ where v0. 52.
Jun 11 18│ where v0. 53.
Jun 11 18│ where v0. 54.
Jun 18 18│ where v0. 5. 5
Jun 19 18│ where v0. 51.
Jul 3 18│ where v0. 56.
Jul 16 18│ where v0. 57.
Aug 10 18│ where v0. 58.
Aug 20 18│ where v06.. 0
Aug 21 18│ where v06.1.
Aug 21 18│ where v06.2.
Aug 22 18│ where v07.. 0
Aug 27 18│ where v07.1.
Aug 28 18│ where v06.. 0
Aug 28 18│ where v07.2.
Aug 29 18│ where v07.3.
Aug 30 18│ where v07.4.
Aug 31 18│ where v07.. 5
Sep 5 18│ where v07.3.
Sep 6 18│ where v08.. 0
Sep 7 18│ where v08.1.
Sep 10 18│ where v08.2.
Sep 14 18│ where v08.3.
Sep 14 18│ where v08.4.
Sep 17 18│ where v08.. 5
Sep 18 18│ where v08.6.
Sep 18 18│ where v08.2.
Sep 18 18│ where v08.7.
Sep 18 18│ where v09.. 0
Sep 18 18│ where v09.1.
Sep 20 18│ where v09.2.
Sep 25 18│ where v09.3.
Sep 27 18│ where v09.4.
Sep 28 18│ where v09.. 5
Oct 4 18│ where v09.6.
Oct 9 18│ where v09.4.
Oct 10 18│ where v010.. 0
Oct 20 18│ where v010.1.
Nov 1 18│ where v010.2.
Nov 6 18│ where v010.2.
Nov 8 18│ where v011.. 0
Nov 9 18│ where v011.1.
Nov 10 18│ where v011.2.
Nov 11 18│ where v011.3.
Nov 13 18│ where v011.3.
Nov 13 18│ where v011.4.
Nov 14 18│ where v011.. 5
Nov 14 18│ where v011.6.
Nov 19 18│ where v011.7.
Nov 19 18│ where v011.7.
Nov 20 18│ where v011.8.
Nov 20 18│ where v011.8.
Nov 21 18│ where v011.9.
Nov 21 18│ where v011.9.
Nov 27 18│ where v011.10.
Nov 27 18│ where v011.10.
Nov 28 18│ where v011.11.
Nov 28 18│ where v011.11.
Nov 29 18│ where v011.12.
Nov 29 18│ where v011.12.
Nov 30 18│ where v011.13.
Nov 30 18│ where v011.13.
Dec 4 18   │ v1. 0. 0
Dec 4 18   │ v1. 0. 0
Dec 4 18   │ v1. 0. 0
Dec 12 18  │ v11.. 0
Jan 26 19  │ v11.8.
Jan 29 19  │ v11.8.
Jan 31 19  │ v12.. 0
Feb 15 19  │ v12.1.
Feb 26 19  │ v12.1.
Feb 26 19  │ v12.1.
Feb 28 19  │ v12.2.
Feb 28 19  │ v13.. 0
Mar 1 19   │ v13.1.
Mar 1 19   │ v13.2.
Mar 4 19   │ v13.3.
Mar 5 19   │ v13.4.
Mar 7 19   │ v13.6.
Mar 7 19   │ v13.7.
Mar 7 19   │ v13.8.
Mar 14 19  │ v13.9.
Mar 15 19  │ v13.10.
Mar 15 19  │ v13.8.
Mar 18 19  │ v13.11.
Mar 18 19  │ v13.12.
Mar 19 19  │ v13.13.
Mar 26 19  │ v13.14.
Mar 26 19  │ v14.. 0
Mar 27 19  │ v14.1.
Mar 27 19  │ v14.2.
Mar 27 19  │ v14.3.
Mar 28 19  │ v14.4.
Mar 28 19  │ v14.. 5
Mar 28 19  │ v14.6.
Mar 29 19  │ v14.6.-hotfix1.
Mar 29 19  │ v14.7.
Apr 3 19   │ v14.8.
Apr 4 19   │ v14.9.
Apr 4 19   │ v14.10.
Apr 8 19   │ v14.11.
Apr 9 19   │ v14.12.
Apr 10 19  │ v14.13.
Apr 10 19  │ v14.14.
Apr 10 19  │ v14.15.
Apr 11 19  │ v14.16.
Apr 11 19  │ v14.17.
Apr 12 19  │ v14.18.
Apr 12 19  │ v14.9.-hotfix1.
Apr 16 19  │ v1. 5. 0
Apr 17 19  │ v1. 51.
Apr 17 19  │ v1. 52.
Apr 19 19  │ v1. 53.
Apr 22 19  │ v1. 54.
Apr 23 19  │ v1. 5. 5
Apr 24 19  │ v1. 56.
Apr 24 19  │ v1. 57.
Apr 26 19  │ v1. 58.
Apr 26 19  │ v1. 54.
Apr 30 19  │ v1. 54.-hotfix1.
May 2 19   │ v1. 54.-hotfix2.
May 7 19   │ v1. 54.-hotfix2.
May 17 19  │ v16.. 0
May 22 19  │ v16.1.
May 23 19  │ v16.2.
May 24 19  │ v16.3.
May 28 19  │ v16.4.
May 28 19  │ v16.. 5
May 29 19  │ v16.6.
May 30 19  │ v16.3.
May 31 19  │ v16.7.
Jun 3 19   │ v17.. 0
Jun 4 19   │ v17.1.
Jun 6 19   │ v17.2.
Jun 7 19   │ v17.3.
Jun 14 19  │ v17.4.
Jun 21 19  │ v17.6.
Jun 22 19  │ v17.7.
Jun 22 19  │ v17.8.
Jun 25 19  │ v17.9.
Jun 26 19  │ v17.10.
Jun 28 19  │ v17.11.
Jul 2 19   │ v17.8.+hotfix2.
Jul 8 19   │ v17.8.+hotfix2.
Jul 9 19   │ v17.8.+hotfix3.
Jul 9 19   │ v17.8.+hotfix3.
Jul 11 19  │ v18.1.
Jul 19 19  │ v18.2.
Jul 19 19  │ v17.8.+hotfix4.
Jul 24 19  │ v17.8.+hotfix4.
Jul 31 19  │ v18.3.
Aug 8 19   │ v18.3.
Aug 15 19  │ v19.. 0
Aug 21 19  │ v19.1.
Aug 21 19  │ v19.2.
Aug 22 19  │ v19.3.
Aug 23 19  │ v19.4.
Aug 24 19  │ v19.. 5
Aug 29 19  │ v19.6.
Aug 29 19  │ v19.7.
Sep 4 19   │ v19.1.+hotfix1.
Sep 6 19   │ v110.. 0
Sep 8 19   │ v19.1.+hotfix2.
Sep 9 19   │ v110.1.
Sep 10 19  │ v19.1.+hotfix2.
Sep 14 19  │ v110.2.
Sep 17 19  │ v110.3.
Sep 19 19  │ v110.4.
Sep 20 19  │ v110.. 5
Sep 25 19  │ v110.6.
Sep 26 19  │ v19.1.+hotfix3.
Sep 27 19  │ v19.1.+hotfix4.
Oct 1 19   │ v19.1.+hotfix4.
Oct 2 19   │ v110.7.
Oct 4 19   │ v110.8.
Oct 4 19   │ v110.9.
Oct 4 19   │ v110.10.
Oct 4 19   │ v110.11.
Oct 4 19   │ v110.12.
Oct 8 19   │ v110.13.
Oct 8 19   │ v110.14.
Oct 10 19  │ v110.7.
Oct 17 19  │ v19.1.+hotfix. 5
Oct 23 19  │ v19.1.+hotfix6.
Nov 7 19   │ v110.15.
Nov 11 19  │ v110.16.
Nov 13 19  │ v111.. 0
Nov 14 19  │ v112.. 0
Nov 15 19  │ v112.1.
Nov 15 19  │ v112.2.
Nov 18 19  │ v112.3.
Nov 18 19  │ v112.4.
Nov 21 19  │ v112.. 5
Nov 21 19  │ v112.6.
Nov 21 19  │ v112.7.
Nov 22 19  │ v111.. 0
Nov 22 19  │ v112.8.
Nov 22 19  │ v112.9.
Nov 23 19  │ v112.10.
Nov 23 19  │ v112.11.
Nov 25 19  │ v112.12.
Nov 26 19  │ v112.13.
Nov 26 19  │ v112.14.
Nov 27 19  │ v112.15.
Dec 2 19   │ v112.16.
Dec 3 19   │ v112.13.+hotfix1.
Dec 4 19   │ v112.13.+hotfix2.
Dec 5 19   │ v113.. 0
Dec 6 19   │ v112.13.+hotfix3.
Dec 10 19  │ v112.13.+hotfix4.
Dec 11 19  │ v112.13.+hotfix. 5
Dec 11 19  │ v112.13.+hotfix. 5
Dec 11 19  │ v112.13.+hotfix6.
Dec 12 19  │ v113.1.
Dec 13 19  │ v113.2.
Dec 19 19  │ v113.3.
Dec 20 19  │ v113.4.
Dec 21 19  │ v113.. 5
Jan 2 20   │ v113.6.
Jan 7 20   │ v113.7.
Jan 10 20  │ v113.8.
Jan 14 20  │ v113.9.
Jan 15 20  │ v113.6.
Jan 15 20  │ v114.. 0
Jan 16 20  │ v114.1.
Jan 21 20  │ v114.2.
Jan 22 20  │ v114.3.
Jan 25 20  │ v114.4.
Jan 27 20  │ v112.13.+hotfix7.
Jan 27 20  │ v114.. 5
Jan 29 20  │ v114.6.
Feb 5 20   │ v114.6.
Feb 6 20   │ v115.. 0
Feb 6 20   │ v115.1.
Feb 7 20   │ v115.2.
Feb 11 20  │ v115.3.
Feb 11 20  │ v112.13.+hotfix8.
Mar 4 20   │ v115.4.
Mar 4 20   │ v115.. 5
Mar 5 20   │ v115.6.
Mar 5 20   │ v115.7.
Mar 5 20   │ v115.8.
Mar 5 20   │ v115.9.
Mar 5 20   │ v115.10.
Mar 5 20   │ v115.11.
Mar 5 20   │ v115.12.
Mar 6 20   │ v115.13.
Mar 6 20   │ v115.14.
Mar 6 20   │ v115.15.
Mar 6 20   │ v115.16.
Mar 6 20   │ v115.17.
Mar 6 20   │ v115.18.
Mar 10 20  │ v115.19.
Mar 11 20  │ v115.20.
Mar 13 20  │ v115.21.
Mar 16 20  │ v115.22.
Mar 17 20  │ v115.17.
Mar 18 20  │ v116.. 0
Mar 19 20  │ v116.1.
Mar 24 20  │ v116.2.
Mar 27 20  │ v116.3.
Mar 31 201.17. 0-dev. 0. 0
Apr 1 201.17. 0-dev1.. 0
Apr 2 201.17. 0-dev2.. 0
Apr 2 201.17. 0-dev3.. 0
Apr 2 201.17. 0-dev4.. 0
Apr 4 201.17. 0-dev. 5. 0
Apr 4 201.18. 0-dev. 0. 0
Apr 6 201.18. 0-dev1.. 0
Apr 6 201.17. 0-dev3.1.
Apr 6 201.18. 0-dev2.. 0
Apr 7 201.18. 0-dev3.. 0
Apr 7 201.18. 0-dev4.. 0
Apr 13 201.18. 0-dev. 5. 0
Apr 17 20  │ v112.13.+hotfix9.
Apr 21 201.18. 0-6.0.pre
Apr 22 201.17. 0-3.2.pre
Apr 24 201.18. 0-7.0.pre
Apr 24 201.18. 0-8.0.pre
Apr 28 201.17. 0-3.3.pre
May 2 201.17. 0-3.4.pre
May 5 201.18. 0-9.0.pre
May 6 201.18. 0-10.0.pre
May 6 201.17. 0
May 6 201.18. 0-11.0.pre
May 6 201.18. 0-12.0.pre
May 7 201.18. 0-13.0.pre
May 8 201.19. 0-0.0.pre
May 12 201.19. 0-1.0.pre
May 13 201.171.
May 14 201.18. 0-11.1.pre
May 28 201.172.
Jun 1 201.19. 0-2.0.pre
Jun 2 201.19. 0-3.0.pre
Jun 5 201.19. 0-4.0.pre
Jun 5 201.173.
Jun 9 201.19. 0-5.0.pre
Jun 10 201.19. 0-4.1.pre
Jun 11 201.20. 0-0.0.pre
Jun 18 201.174.
Jun 26 201.20. 0-2.0.pre
Jul 1 201.17. 5
Jul 1 201.19. 0-4.2.pre
Jul 1 201.19. 0-4.3.pre
Jul 5 201.20. 0-3.0.pre
Jul 9 201.20. 0-7.0.pre
Jul 11 201.20. 0-7.1.pre
Jul 17 201.21. 0-1.0.pre
Jul 21 201.20. 0-7.2.pre
Jul 29 201.20. 0-7.3.pre
Aug 3 201.20. 0-7.4.pre
Aug 5 201.20. 0
Aug 6 201.201.
Aug 7 201.21. 0-7.0.pre
Aug 13 201.21. 0-9.0.pre
Aug 13 201.202.
Aug 14 201.202.
Aug 19 201.21. 0-9.1.pre
Aug 21 201.22. 0-1.0.pre
Aug 28 201.21. 0-9.2.pre
Sep 1 201.22. 0-9.0.pre
Sep 2 201.203.
Sep 14 201.22. 0-12.0.pre
Sep 15 201.204.
Sep 16 201.22. 0-12.1.pre
Sep 22 201.23. 0-4.0.pre
Sep 28 201.22. 0-12.2.pre
Sep 29 201.22. 0-12.3.pre
Oct 1 201.22. 0
Oct 1 201.23. 0-7.0.pre
Oct 8 201.22. 0-12.4.pre
Oct 8 201.221.
Oct 12 201.23. 0-13.0.pre
Oct 14 201.23. 0-18.0.pre
Oct 15 201.23. 0-18.1.pre
Oct 16 201.222.
Oct 20 201.24. 0-1.0.pre
Oct 22 201.24. 0-3.0.pre
Oct 30 201.223.
Oct 30 201.24. 0-6.0.pre
Nov 5 201.24. 0-7.0.pre
Nov 13 201.224.
Nov 16 201.24. 0-10.1.pre
Nov 18 201.24. 0-10.2.pre
Nov 19 201.24. 0-10.2.pre
Dec 2 201.25. 0-4.0.pre
Dec 10 201.25. 0-8.0.pre
Dec 10 201.22. 5
Dec 16 201.25. 0-8.1.pre
Dec 16 201.26. 0-1.0.pre
Jan 6 211.25. 0-8.2.pre
Jan 13 211.26. 0-8.0.pre
Jan 15 211.25. 0-8.3.pre
Jan 21 211.26. 0-12.0.pre
Jan 25 211.226.
Jan 29 211.26. 0-17.1.pre
Feb 4 211.26. 0-17.2.pre
Feb 4 211.26. 0-17.2.pre
Feb 5 211.26. 0-17.3.pre
Feb 10 211.26. 0-17.4.pre
Feb 10 211.27. 0-1.0.pre
Feb 11 211.26. 0-17.5.pre
Feb 16 211.26. 0-17.6.pre
Feb 17 211.27. 0-4.0.pre
Feb 24 211.26. 0-17.7.pre
Feb 24 211.27. 0-8.0.pre
Feb 25 211.26. 0-17.8.pre
Mar 3 212.0. 0
Mar 3 212.0. 0
Mar 3 212.1. 0-10.0.pre
Mar 4 212.01.
Mar 4 212.01.
Mar 12 212.02.
Mar 13 212.1. 0-12.1.pre
Mar 15 212.02.
Mar 18 212.1. 0-12.2.pre
Mar 19 212.03.
Apr 2 212.04.
Apr 15 212.2. 0-10.1.pre
Apr 15 212.2. 0-10.1.pre
Apr 16 212.0. 5
Apr 27 212.3. 0-0.1.pre
Apr 29 212.2. 0-10.2.pre
Apr 30 212.06.
May 10 212.2. 0-10.3.pre
May 10 212.3. 0-1.0.pre
May 18 212.2. 0
May 18 212.3. 0-12.1.pre
May 19 212.2. 0
May 27 212.21.
May 28 212.3. 0-16.0.pre
Jun 11 212.22.
Jun 11 212.22.
Jun 17 212.3. 0-24.0.pre
Jun 25 212.3. 0-24.1.pre
--------------------------------------
Jul 1 212.23.             stable
--------------------------------------
Jul 2 212.4. 0-0.0.pre
Jul 13 212.4. 0-4.0.pre
Jul 22 212.4. 0-4.1.pre
Jul 22 212.4. 0-4.2.pre
Jul 27 212.5. 0-1.0.pre
Aug 5 212.5. 0-5.0.pre
Aug 12 212.5. 0-5.1.pre
--------------------------------------
Aug 12 212.5. 0-6.0.pre     dev
--------------------------------------
--------------------------------------
Aug 19 212.5. 0-5.2.pre     beta
--------------------------------------

C:\Users\85285>
Copy the code

fvm install

fvm install: Installs Flutter SDK Version. Gives you the ability to install Flutter releases or channels.

  • fvm install dev/beta/stable/...Install the current version of the flutter SDK for the specified channel.
  • FVM install 2.2.0Install the flutter SDK of the specified version (2.2.0).

If the FVM_HOME or FVM_GIT_CACHE environment variable is not configured, the installation is in ~/ FVM /versions/ by default.

Install the specified version and channel as follows:

FVM install 1.20.4: this version is used for older projects;

  • FVM install 1.22.6The last stable version 1.22.6 before flutter 2.0 was installed
  • fvm install stable: Since the current stable is 2.2.0, the installed stable is equivalent toFVM install 2.2.0;
  • fvm install devInstall the latest dev 2.3.0-12.1.pre preview for some experimental feature development and validation;

After you run FVM install 2.2.0, you can run FVM remove 2.2.0 to uninstall version 2.2.0.

fantasy@MBP ~ $ tree -L 1 ~/fvm/Versions/Users/fantasy/FVM/versions ├ ─ ─1.226.├ ─ ─ dev └ ─ ─ stable3 directories, 0 files

  
 
Copy the code

fvm list

List View the versions that have been installed locally.

fantasy@MBP ~ $ fvm list
Cache Directory:  /Users/fantasy/fvm/versions

stable
dev
1.226.

  
 
Copy the code

fvm use

To switch the FLUTTER SDK version, run FVM use version in the current Flutter_project directory.

FVM will create a relative symlink in your project from .fvm/flutter_sdk to the cache of the selected version. Add it to your .gitignore.

A.fvm folder is generated in the current directory. Consider adding.fvm/* to the.gitignore file to avoid misuploading to the library.

Execute FVM use STABLE under the flutter project my_Flutter_project to switch the flutter SDK to the latest stable version:

fantasy@MBP ~/Projects//my_flutter_project $ fvm use stable
Project now uses Flutter [stable]

  
 
Copy the code

Where. FVM /flutter_sdk links to ~/ FVM /versions/stable; “FlutterSdkVersion “: “stable” is synchronized in configuration file. FVM /fvm_config.json.

Next, you can use FVM flutter instead of the flutter command to automatically pick up the SDK used by the current REPO.


Execute the FVM list in the current project directory. The currently used flutter SDK version will be identified as active:

fantasy@MBP ~/Projects//my_flutter_project $ fvm list Cache Directory: /Users/fantasy/fvm/versions

stable (active)
dev
1.226.

  
 
Copy the code

Run the FVM flutter –version command in the current project directory to check the flutter SDK version information:

fantasy@MBP ~/Projects//my_flutter_project $ fvm flutter --version
Flutter 2.2.0 • channel stable • https://github.com/Git Framework • Revision B22742018b (11Days, a line)2021-05-14 19:12:57 -0700
Engine • revision a9d88a4d18
Tools • Dart 2.13. 0

  
 
Copy the code

Run other agent commands to install dependency updates, run:

fvm flutter clean
fvm flutter pub get
fvm flutter run

  
 
Copy the code

fvm flavor

“Project Flavors” is an flavors that can be changed into a flavors SDK version that is available on the periphery of a project. However, the adaptation of Flutter 2 is in progress.

Pin flavor version

Specify a flavor alias for a FLUTTER SDK version.

To choose a Flutter SDK version for a specific flavor you just use the use command.

fvm use {version} --flavor {flavor_name}

  
 
Copy the code

Flavors map (flavor_name -> version) will be recorded in the configuration file. FVM /fvm_config.json.

fantasy@MBP ~/Projects//my_flutter_project $FVM use 1.22.6 --flavor production Project now uses Flutter [1.22.6] on [production] flavor. fantasy@MBP ~/Projects//my_flutter_project $ fvm use stable --flavor stable
Project now uses Flutter [stable] on [stable] flavor.

fantasy@MBP ~/Projects//my_flutter_project $ fvm use dev --flavor dev Project now uses Flutter [dev] on [dev] flavor. fantasy@MBP ~/Projects//my_flutter_project $ cat .fvm/fvm_config.json
{
  "flutterSdkVersion": "stable"."flavors": { "production": "1.22.6"."stable": "stable"."dev": "dev"}}Copy the code

View flavors

List all configured flavors of the current project configuration.

fantasy@MBP ~/Projects//my_flutter_project $ fvm flavor Project flavors configured for "my_flutter_project": [1] production [2] dev [3] stable Select an environment: ^CCopy the code

As prompted, type 2 or dev after Select an environment to switch to the dev development environment. To view information, press Ctrl+C to exit.

Switch flavors

Will get the version configured for the flavor and set as the project version.

fvm flavor {flavor_name}

  
 
Copy the code

Switch to the version corresponding to flavor_name for the current project.

For example, FVM Flavor Production will switch to version 1.22.6, equivalent to FVM Use 1.22.6.

After the switchover, flutterSdkVersion in.fvm/fvm_config.json will be synchronized to 1.22.6.

IDE configuration

vscode

But global configuration vscode (~ / Library/Application/Support/Code / – \ Insiders/User/Settings. Json) :

{
  "dart.flutterSdkPaths": ["/Users/usr/fvm/versions"]}Copy the code

or

{
  "dart.flutterSdkPaths": [ "/Users/usr/fvm/versions/stable"."/Users/usr/fvm/versions/dev"]}Copy the code

Execute Flutter in vscode control panel: Change SDK Switch the Flutter SDK version to the vscode configuration file.vscode/settings.json of the current project (dart.fluttersdkpath).


You can also directly edit the vscode configuration file of the current project. Vscode /settings.json:

{
  "dart.flutterSdkPath": ".fvm/flutter_sdk".// or "dart.flutterSdkPaths": [".fvm/flutter_sdk"] // Remove .fvm files from search
  "search.exclude": { "**/.fvm": true
  },
  // Remove from file watching
  "files.watcherExclude": { "**/.fvm": true}}Copy the code

AndroidStudio

Refer to the configuration.

fvm global

If the APP has not been adapted to Flutter 2.0, you can set The 1.22.6 to the global main version for now.

FVM global 1.22.6 prompts you to add related paths to PATH:

fantasy@MBP ~ $ fvm global 1.226.
Flutter "1.22.6" has been set as global
However your "flutter" path current points to:

.
to use global Flutter SDK through FVM you should change it to:

/Users/fantasy/fvm/default/bin

  
 
Copy the code

Vim ~/.zshrc open the ZSH configuration and add the PATH of the default Flutter SDK executable to the environment variable PATH:

export PATH=$HOME/fvm/default/bin:$PATH

  
 
Copy the code

Go into the ~ / FVM directory and you can see that default is actually the surrogate soft chain for Versions /1.22.6.

If the iOS project reports any of the following errors, consider executing the Flutter Precache repull tool chain to resolve them.

[!]  Invalid`Podfile` file: No such file or directory @ rb_file_s_stat - /Users/fantasy/fvm/versions/1.226./bin/cache/artifacts/engine/ios/Flutter.framework.

  
 
Copy the code

Re-execute the FVM list and you can see that 1.22.6 has been identified as global:

fantasy@MBP ~ $ fvm list
Cache Directory:  /Users/fantasy/fvm/versions

stable
beta
1.226. (global)

  
 
Copy the code

If flutter –version is executed, the global version of FLUTTER is displayed as FLUTTER 1.22.6 and Dart 2.10.5.

fvm taps

The following are two folk FVMS that are more common on the Internet and can be used optionally.

dashixiong91

Xinfeng-tech/FVM is introduced at the end of this paper

dashixiong91 / fvm – dashixiong91 / homebrew-fvm

brew tap dashixiong91/fvm
brew install fvm

  
 
Copy the code
  • Flutter Versions Manager
  • The Flutter SDK multi-version management tool

The following is based on the old Xinfeng-tech/FVM:

  • Use FVM to help you eat the Flutter2-VS code configuration
  • Android Studio configuration for managing multiple versions of Flutter on FVM – Mac

befovy

Go-fvm: Flutter version change assistant: befovy/FVM

The core logic is to cache multiple Flutter versions in local folders and create soft links for projects specifying Flutter versions. Or create a specific version of Flutter soft link in the global environment.