When the analyser stops seeing Widget, it means VS Code is no longer using the Flutter SDK libraries even if your imports look fine.
This is what you need to do:
Run flutter doctor -v in the project folder to confirm Flutter itself is intact and fix anything it reports.
In VS Code press Ctrl+Shift+P > Flutter: Change SDK, and point it to your Flutter install
Open .vscode/settings.json or global settings and remove any dart.sdkPath that points to a standalone Dart SDK; the analyzer must use Flutter’s bundled Dart SDK. Restart VS Code afterward.
Finally run flutter pub get to rebuild .dart_tool/package_config.json so the analyser re-indexes Flutter packages.
// .vscode/settings.json
{
"dart.flutterSdkPath": "/Users/you/flutter",
"dart.sdkPath": ""
}