I use Android Studio as my IDE in coding Flutter. I was able to create 2 projects before this and it worked absolutely fine. I had to clone a repo from Github. The IDE said
I've had the same issue and what worked for me is to re-import the project.
File > Close Project, go to the project's directory and delete the .idea folder.
Then File > Open... and re-open the project.
Open Project Structure, you can set the project's SDK with what you have.
After this, I was able to run main.dart with the emulator.