'vscode editor with flutter give incorrect errors

While typing in vscode with flutter, I get incorrect errors. it seems the editors has incorrect text and the problem is solved only when i close and open the file again

It happens all the time now.

I attached image presenting what happens when i am typing code in flutter. There is nothing wrong with the function but i get errors

enter image description here

When I close and open the evetyhing is ok

enter image description here

Tried allready to reopen flutter, reinstall flutter, flutter clean, reinstall vscode, download the project again from github



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source