Autocomplete not working correctly in Android Studio with Flutter - First suggestions are irrelevant
Solution 1
This problem can be fixed by one of the following
- Invalidate caches and Restart fixed my problem. Goto
File-> Ivalidate caches / Restart -> Invalidate and Restart
Note all above solutions works but are not permanent as it appears there is bug in latest dart Analysis server you can follow subscribe to this reported issue for more updates
Solution 2
Restart Dart Analysis Server :-
- Navigate to Dart Analysis tab at bottom.
- Click Restart Icon (red colored icon on top left corner of Dart Analysis Window)
- Wait for dart analysis to finish.
If it does not work, try this :-
- Delete .packages and pubspec.lock files present in your project folder
- run
flutter pub get
Solution 3
In my case, I run in android studio terminal:
flutter upgrade
Omri1100
Updated on December 17, 2022Comments
-
Omri1100 over 1 year
I installed Flutter and Android Studio. I ran flutter doctor - Flutter doctor
I have the Dart plugin installed - v191.8593.
When I press Ctrl + Space at a very obvious place the AutoComplete do not suggest the right suggestions. Example:
As you see the first suggestion are not of type ScrollPhysics and are out of context, and after I scroll down, there are ScrollPhysics suggestions, but they are after some scrolling.