https://stackoverflow.com/a/45339159 to apply this fix 1) flutter pub get
2) restart vscode if error still shows, instead of using the file menu:
Open the command palette ( Ctrl + Shift + P ) and execute the command: >Reload Window.

On other Ctrl + Shift + P shortcuts, there is also a command to clear the VSCode terminal ; ctrl-l also works. Becuase ctrl-a ctrl-k cannot be used to clear the terminal line, just alt-b to the start of the line then alt-d to delete all words