Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio code suggestions doesn't work for Flutter

I'm experiencing a problem with Android Studio and the Flutter framework.

The code completion suggestions Android Studio shows are now incoherent types when I develop mobile apps with Flutter, but, in Visual Studio Code code completion works fine. (And it used to work in Android Studio too, but i may have broken something without knowing it.)

Here is Android Studio ScreenShot

And here is the Visual Studio Code ScreenShot

As you can see, Visual Studio Code proposes all of the types that make sense for this specific attribute. But the Android Studio shows something else entirely -- I cannot even find those types there.

I have tried the following:

  • Reinstalled Android Studio.
  • Invalidated caches and restarted.
  • Re-downloaded the flutter SDK
  • Re-downloaded the Dart SDK

I am using the latest versions of Android Studio, Flutter and Dart. Any help will be appreciated.

like image 201
Aspyxia1_3 Avatar asked Dec 18 '19 17:12

Aspyxia1_3


3 Answers

Try updating your flutter plugin in Android Studio.

  1. Open Android Studio
  2. File -> Settings -> Plugin -> Updates
like image 54
Aman Lahariya Avatar answered Oct 16 '22 18:10

Aman Lahariya


Settings>Editor>General>Code Completion> Set tick on "Show the documentation popup" and adjust how fast you want it to appear.

enter image description here

like image 43
Oleksandr Avatar answered Oct 16 '22 19:10

Oleksandr


Try clearing .packages .dart_tool directory and pubspec.lock and then restarting android studio. That worked for me.

I found this solution on github: https://github.com/flutter/flutter-intellij/issues/4229#issuecomment-567241643

like image 31
jonasxd360 Avatar answered Oct 16 '22 19:10

jonasxd360