flutterdartnull-safety

how to migrate flutter mid-level existing project null safety?


I am trying to upgrade my existing Flutter project to null-safety. When I upgrade the Flutter version to the latest one, as expected it gives thousands of errors due to null safety.

What is the best approach to resolve this issue? Please consider that it is a mid-level existing project.


Solution

  • Sadly there is no easy way to do it without having to seeing error. I was able to update two projects with dart migrate and then view the migration suggestions by visiting the link in command line.

    If haven't, follow the instruction here and watch the video to understand the process.

    https://dart.dev/null-safety/migration-guide#step2-migrate