From the error message, you need to upgrade your idk to 17 or higher. To do this, download the jdk17 from Oracle site and then run the following command:
flutter config --jdk-dir <path_to_new_jdk>
If you rerun flutter doctor --verbose after this you should see it now updated.