# How to upgrade the Flutter project

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) -&gt; 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
    
    ```plaintext
      sdk: '>=3.1.0 <4.0.0'
    ```
    
3. Run 'flutter pub get'
    
4. Now let's update all the dependencies via the following command
    
    ```plaintext
    flutter pub outdated
    ```
    
    'flutter pub outdated' -&gt; This command can help us to see all the possible versions.
    
5. Now once we have checked and reviewed run the below commands
    
6. ```plaintext
    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.
