How to downgrade your flutter SDK version?

Viewed 23459

My current Dart SDK Version is 2.1.2-dev.0.0.flutter-0a7dcf17eb. However i need to use a flutter text recognition Dependency that requires SDK version >=1.23.0 <2.0.0

How can I downgrade my version?

4 Answers

In the Flutter install directory execute

git checkout v1.2.2

Now run

flutter doctor

You can just go from a version to another using the new commands

  • flutter downgrade -> go to the previous
  • flutter upgrade -> update to the new one

If you have a specific version of Flutter that you want to switch to (e.g. a previous stable version), you can use the flutter version command:

First find the version you wish to switch to here: https://flutter.dev/docs/development/tools/sdk/releases

Then, use flutter version command:

 flutter version v1.9.1+hotfix.3

To pin Flutter package to a specific version, specify Flutter version explicitly in the pubspec.yaml file environment section:

environment:
  sdk: '>=1.19.0 <3.0.0'
  flutter: ^0.1.2

You have to run one command

flutter version

Above command shows you list of flutter version after that you can choose any version from that list. Using for example flutter version v1.9.1+hotfix.6

Related