Upgrade and Migrate Flutter Project to 2.

Upgrade and Migrate Flutter Project to 2.

In 10Steps.

ยท

1 min read

If you guys face this type of error in your old flutter project then it's blog for you ๐Ÿ˜Š

image_2021-09-29_200900.png

Follow these lines ๐Ÿ‘‡

  1. Run flutter upgrade in the terminal to upgrade Flutter (Optional if you already did).

  2. Run dart migrate to run the dart migration tool.(In project Terminal).

  3. Solve all errors which the migration tool shows.

  4. Run flutter pub outdated --mode=null-safety to print all outdated packages.

Example Image

image.png

You can see if the packages you depend upon support null-safety.

  1. Run flutter pub upgrade --null-safety to upgrade all packages automatically.

  2. Check the code for errors and solve them.

  3. Run dart migrate again and it should now be successful. Follow the link to checkout the proposed changes.

  4. Close your ide and reopen that.

  5. Check the code for errors again and fix them.

Congratulations, when finished you should now be able to run the app with sound null-safety.

  1. Run flutter run in the command line and the application should run with the command line displaying:)

image.png

Thank you Follow me for more..

ย