How do I upgrade an existing Flutter app?

The following steps requires dart 2.19 tool or lower because the dart
migrate tool is removed in version 3:

To update the project to null safety follow these steps:

Side note: change the flutter version in pubsec.yaml, make new project and copy the following line:

sdk: ">=2.19.6 <3.0.0"

Then follow the steps:

  1. Run flutter upgrade in the terminal to upgrade Flutter
  2. Run dart migrate to run the dart migration tool.
  3. Solve all errors which the migration tool shows.
  4. Run flutter pub outdated --mode=null-safety to print all outdated packages.
  5. Run flutter pub upgrade --null-safety to upgrade all packages automatically.
  6. Check the code for errors and solve them (Very important).
  7. Run dart migrate again and it should now be successful. Follow the link to checkout the proposed changes.
  8. Press the “Apply Migration” button.
  9. Check the code for errors again and fix them.

Your project should be updated now.
Referenced from this website.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)