Downgrading Flutter to a Specific Version

In this detailed guide, you will learn how to step back and downgrade the version of Flutter to a specific version. This step-by-step process will help you to downgrade Flutter in a proper way on macOS, Windows or Linux. Why Downgrade Flutter? Let’s have a quick look at why we need to downgrade Flutter to…

By.

•

min read

In this detailed guide, you will learn how to step back and downgrade the version of Flutter to a specific version. This step-by-step process will help you to downgrade Flutter in a proper way on macOS, Windows or Linux.

How to Downgrade Flutter Version?

Why Downgrade Flutter?

Let’s have a quick look at why we need to downgrade Flutter to a lower version:

  • Compatibility Issues: Sometimes, new Fluter releases may introduce breaking changes, which can affect the working of existing applications. In such cases, to maintain the stability we need to downgrade.
  • Plugin Compatibility: Major or critical plugins may not be compatible to work smoothly with latest release.
  • Legacy Projects: Older projects developed on earlier versions may face issues, so downgrading can make maintenance easy for production versions of applications.

 

Prerequisites

Before we start looking at how to downgrade, make sure you have installed Flutter on your system. You can follow the official Flutter installation guide to set it up.

 

How to Downgrade Flutter Version?

Follow these steps to downgrade the version of Flutter version:

Step 1: Checking Available Flutter Versions
Step 2: Choosing the Version to Downgrade
Step 3: Switching to the Chosen Version
Step 4: Verifying the Downgrade
Step 5: Updating Dependencies
Step 6: Rebuilding Your Project

 

Step 1: Checking Available Flutter Versions

The first step while downgrading Flutter is to check the available version by listing them using the below command:

flutter versions

 

This command displays a list of available Flutter versions, that will allow you to pick the one you need. The output will be as below:

flutter versions

    2.5.0 • channel stable • https://github.com/flutter/flutter.git
    2.4.0 • channel stable • https://github.com/flutter/flutter.git
    2.3.0 • channel stable • https://github.com/flutter/flutter.git
    2.2.3 • channel stable • https://github.com/flutter/flutter.git
...
...

 

Step 2: Choosing the Version to Downgrade

After listing the available Flutter versions, we can easily choose the one that is suitable for our project. We can jot down the required version to be used in further steps.

 

Step 3: Switching to the Chosen Version

Now, we will perform the downgrade process. Just replace the x.y.z with your chosen version number:

flutter downgrade x.y.z

Flutter will download and switch to the specified version provided in the above downgrade command.

 

Step 4: Verifying the Downgrade

After the downgrade command is completed, we can verify that now we have the correct Flutter version by hitting below command:

flutter --version

This will display the version currently we have, make sure it’s the one we intended to downgrade to.

 

Step 5: Updating Dependencies

After the Flutter version is downgraded, we need to adjust the dependencies accordingly. Modify your pubspec.yaml file to specify compatible versions of packages and plugins. For example:

dependencies:
  some_plugin: ^1.2.3

 

Step 6: Rebuilding Your Project

To make sure, everything is working correctly, execute following command to rebuild the project:

flutter clean
flutter pub get
flutter run

With this step, you have successfully downgraded Flutter while keeping your project in working order.

 

Conclusion

In this detailed and step-by-step guide, we discussed how to easily downgrade the Flutter version to any of the versions on macOS, Windows, or Linux. Flutter is a versatile framework to work with, so management of the version is crucial. Hope this quick guide will be helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *