1

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 https://i.stack.imgur.com/aCHkJ.png

For main.dart https://i.stack.imgur.com/kJ96q.png

2
  • You probably need to have typed something yourself. Try putting in the import material.dart line of code. There is no syntax to highlight in the questions.dart file you show, it is an empty file.
    – GrahamD
    Aug 2, 2020 at 8:02
  • I added a few lines of code but still nothing.
    – user14036065
    Aug 2, 2020 at 11:26

2 Answers 2

14

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy