This issue typically happens if VS Code and Command Prompt are pointing to different Flutter SDK paths.
Check and Verify Flutter SDK in VS Code:
In VS Code, open the Command Palette (View > Command Palette), type "Flutter: Change SDK", and choose the correct Flutter path to match the version in CMD.
Update Environment Variables:
Ensure only the correct Flutter SDK path is in your system’s PATH. Remove if any duplicate or outdated paths found:
Confirm Flutter sdk Version:
Run flutter --version in both CMD and the VS Code terminal to verify they’re using the same SDK at both.