Autocomplete not working correctly in Android Studio with Flutter - First suggestions are irrelevant

8,524

Solution 1

This problem can be fixed by one of the following

  1. Invalidate caches and Restart fixed my problem. Goto

File-> Ivalidate caches / Restart -> Invalidate and Restart

  1. Restart Dart Analysis Server. Follow the pic below enter image description here

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 :-

  1. Navigate to Dart Analysis tab at bottom.
  2. Click Restart Icon (red colored icon on top left corner of Dart Analysis Window)
  3. Wait for dart analysis to finish.

If it does not work, try this :-

  1. Delete .packages and pubspec.lock files present in your project folder
  2. run flutter pub get

Solution 3

In my case, I run in android studio terminal:

 flutter upgrade
Share:
8,524
Omri1100
Author by

Omri1100

Updated on December 17, 2022

Comments

  • Omri1100
    Omri1100 over 1 year

    I installed Flutter and Android Studio. I ran flutter doctor - Flutter doctor

    I have the Dart plugin installed - v191.8593. image

    When I press Ctrl + Space at a very obvious place the AutoComplete do not suggest the right suggestions. Example:

    View animation here

    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.