Reputation:
Even with the CTRL+SPACE
shortcut, the options I get are nowhere near relevant to the code.
I created a new file named questions.dart
in the lib folder along with main.dart
. In main.dart
the code autocomplete works fine but in question.dart
, it doesn't. Also, the syntax is not getting highlighted as well in the new file.
For questions.dart
For main.dart
Upvotes: 1
Views: 5881
Reputation: 11
I'm facing the same issue here. I managed to solve it by switching flutter channel from master to beta. Now autocomplete works, but sometimes things still get crazy.
Upvotes: 1
Reputation: 1411
Restart the Dart Analysis Server. If that doesn't work, restart your IDE.
This happens to me occasionally. I believe it's an issue with the Dart Analysis Server. Usually, restarting the Dart Analysis Server fixes it.
To restart the Dart Analysis Server. Press ctrl + shift + p
. Then search look for a command called Dart: Restart Analysis Server
. If it doesn't work restart your IDE.
Upvotes: 14