Skip to main content

Command Palette

Search for a command to run...

How to upgrade the Flutter project

Flutter SDK 2.0 to 3.0

Updated
1 min read
How to upgrade the Flutter project
K

I'm leading or guiding a flutter team(2-3 people) at ketto.org where I've to make apps in solid form which matches the industry app standards. I've more than 5 years of experience [2+yr remote] in mobile platforms

with service and product- based companies. I'm very

passionate to write code for thousands of users.

I'm sharing my experience when I upgraded my existing application to the latest Flutter SDK version.

This is a practice that I suggest to every Flutter developer who wants to upgrade his existing application to the latest version of Flutter SDK.

(Optional) -> Create a new instance/user account to your existing Mac/windows system to not affect your current project settings and configuration. Because we can't take risk for existing project. I do the same on my MacBook, creating a new user login and configuring everything.

Now open a terminal and come to your project path. (c/path/to/your/project)

  1. run 'flutter upgrade'

  2. Update project dart version

       sdk: '>=3.1.0 <4.0.0'
    
  3. Run 'flutter pub get'

  4. Now let's update all the dependencies via the following command

     flutter pub outdated
    

    'flutter pub outdated' -> This command can help us to see all the possible versions.

  5. Now once we have checked and reviewed run the below commands

  6.  flutter pub upgrade --major-versions
     flutter clean
     flutter pub get
    
  7. We can use 'dart fix' and 'dart migrate' while updating the dart version and error fix. Note 'dart analyse' also helps.