KRBILN
KRBILN

Reputation: 81

how to downgrade flutter version?

Im trying to downgrade to 3.0.5 with terminal and typed

git reset --hard e85ea0e79c6d894c120cda4ee8ee10fe6745e187

but error says

fatal: not a git repository (or any of the parent directories): .git

how can I solve??

Upvotes: 2

Views: 10211

Answers (3)

Septian Dika
Septian Dika

Reputation: 596

There a documentation to switch to spesific flutter version here. No need for Third package/library.


To switch to a specific Flutter version:

  1. Find your desired Flutter version on the Flutter SDK archive.

  2. Navigate to the Flutter SDK: cd /path/to/flutter

Tip! You can find the Flutter SDK's path using flutter doctor --verbose.

  1. Use git checkout to switch to your desired Flutter version: git checkout <Flutter version>

After following the step, if you try to run flutter doctor --version you will be informed that you are on the [user-branch] channel.


To back to the latest version

  1. Check the available channel: flutter channel

  2. Choose the channel: flutter channel <Channel name>

Upvotes: 0

Sugan Pandurengan
Sugan Pandurengan

Reputation: 723

**** 2024 EDIT ***

it is no longer possible to downgrade flutter with this command. the flutter downgrade command downgra only to the penultimate version.

**** end of 2024 EDIT****

flutter downgrade 3.0.5

Change the version from 3.0.5 to as your wish

Run this command.

Upvotes: 6

Randal Schwartz
Randal Schwartz

Reputation: 44220

Stop installing and uninstalling versions! Get yourself an install of package:fvm, aka https://pub.dev/packages/fvm, aka http://fvm.app. You can have per-project selection of any flutter version that has been published, as well as keep the latest version as your global default.

Upvotes: 4

Related Questions