Verify you are on Flutter version 2.5 or newer using flutter --version

If needed, use flutter upgrade to update to the latest version of the
Flutter SDK

Backup your project with git (or your preferred version control system),
since you need to reapply any local changes you’ve made (if any) to your
project in a later step

Delete all files under the windows/runner folder

Run flutter create --platforms=windows . to recreate the Windows project

Review the changes to files in the windows/runner folder

Reapply any custom changes made to the files in the
windows/runner folder prior to this migration

Verify that your app builds using flutter build windows