As mentioned here:
If you send a priority file that is not otherwise analyzed, the server analyzes it, but doesn’t flush its errors when it’s removed from priority files. This causes the errors to hang around (I would expect until the IDE restarts, however due to caching maybe it’s forever unless you clear ~./dartServer
based on Dart-Code/Dart-Code#1480 (comment)?).
This was fixed by 0aed132. Errors are no longer sent for ignored files (whether open or not).