I had the same problem after importing a flutter project from git. These are the steps to solve the problem.
- File->Settings->Language & Framework->Flutter
- Choose flutter SDK path: the first time we install flutter, we choose the location where the flutter should be installed. Choose this location.
- Click OK and the android studio will refresh. Carry on if the problem is solved.
- If you are still stuck with the error.
- Goto this link and install Dart.
- Goto the same place in settings, ..Language & Framework->Dart and chose the SDK location.
This solved the issues for me.