This solved the issues for me.
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.
Go to this link https://flutter.dev/docs/get-started/... and install Dart.
Go to the same place in settings, ..Language & Framework- Dart and chose the SDK location.