The same problem faced me, but trying the above solution was not helpful. So I tried another thing:
- Open File
- Select settings from the File menu
- Select Languages & frameworks from the left panel
- Select Flutter
- Then from the right panel choose the location of your flutter SDK
The location of flutter SDK is where you copied or cloned the code. In my case it was like the following:
If the specified location contains the flutter SDK, the version section will contain your flutter version. If not, the version section will not contain any versions and there will be a message in the bottom of the setting dialog saying:
Flutter SDK Is Not Found In The Specified Location
Hope this helps.