Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify local Flutter version (e.g. an older release)?

Tags:

flutter

I would like to test my application / package running on an older version of Flutter, e.g. specifically Flutter v2.2.3.

There are 2 commands, flutter upgrade and flutter downgrade which might seem to be relevant, but how do I select the specific version of Flutter I want to use? flutter upgrade --help and flutter downgrade --help do not provide any extra information.

like image 662
Ben Butterworth Avatar asked Dec 12 '25 09:12

Ben Butterworth


2 Answers

Recommended (git): Just checking out a specific commit in the Flutter repo

  • Change directory to your flutter installation folder, e.g. /opt/flutter.
  • git checkout the git tag (change to the branch pointed by the tag). For example, there is a git tag called 2.5.0 for the version 2.5.0, so run git checkout 2.5.0. (Thanks Eugene :) )
    • Or alternatively, if I want version 2.5.0, I can get the commit SHA (ref) from the Flutter SDK releases page. That website says the ref for 2.5.0 is 4cc385b. At the flutter installation directory, run git checkout 4cc385b.
  • Then in the terminal, run flutter (or any specific flutter command) to download and build this version of flutter.

Using FVM (Flutter version Management)

  • You also specify the specific version of Flutter using FVM, e.g. fvm use 2.5.1

Download the specific version of Flutter from Flutter SDK releases and install it.

  • This is the slowest way, as you would have to download the entire repo again.
like image 53
Ben Butterworth Avatar answered Dec 14 '25 06:12

Ben Butterworth


Using Homebrew:

  1. Find the cask of the version you want to install homebrew-cast git history: https://github.com/Homebrew/homebrew-cask/commits/master/Casks/f/flutter.rb

  2. Click on the icon for "View at this point in history"

  3. Click on Raw

  4. Copy the URL from your browser.

    Example: https://raw.githubusercontent.com/Homebrew/homebrew-cask/b029783b06b38177c7e3b36ca824789d516468c1/Casks/f/flutter.rb

  5. brew install --cask https://raw.githubusercontent.com/Homebrew/homebrew-cask/b029783b06b38177c7e3b36ca824789d516468c1/Casks/f/flutter.rb

  6. Check flutter --version

like image 25
martn_st Avatar answered Dec 14 '25 06:12

martn_st