Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode dart analyzer stopped recognizing flutter/dart code

I have been using VSCode for flutter development without issue, then today all of a sudden the dart analyzer is complaining that the majority of the classes are undefined, or targets do not exists.

Has anyone seen this before?

I have restarted VSCode, restarted computer, uninstalled flutter/dart plugins, ran flutter doctor with no issues...I am out of ideas.

VSCode Issues

like image 292
Stephen Stewart Avatar asked Feb 01 '19 23:02

Stephen Stewart


2 Answers

Go to pubspec.yaml, right click and do Get Packages. It seems to work for me all the time.

like image 116
Aditya Nigam Avatar answered Sep 22 '22 15:09

Aditya Nigam


I got this problem too then I reinstalled dart and flutter plugin from androod studio and it's fixed.

like image 33
siva Avatar answered Sep 22 '22 15:09

siva