We got another problem. When we type init it does not show initState method in possible match list. In fact it doesn't show any matching list.
Inside a statefulWidget if we typed the keyword "set" a list of possible match shows up. In the list there was a method named setState((){}) to trigger rebuild to update UI on user interaction.
But recent Chipmunk version of android studio doesn't show the setState((){}) method in the possible match list. Any idea? [ If duplicate, let us know ]

- 17
- 5
-
Related: https://stackoverflow.com/questions/18370599/android-studio-auto-complete-and-other-features-not-working – JS_LnMstr May 19 '22 at 16:04
-
The solution mentioned doesn't working. Now we are switching to Artic Fox version (That was less buggy as far as we remember) @JS_LnMstr – Naim Hasan Pappu May 20 '22 at 14:10
4 Answers
Clean your cache of Android Studio
Go to File -> Invalidate Caches / Restart

- 2,340
- 1
- 5
- 22
See, that error happens quite a few times, and the best way is to remember the syntax.
I'd suggest you complete the syntax yourself and see flutter recognize it.
moreover, you can run flutter clean
and flutter build
in terminal, and invalidate caches from the files group.
Upvote if it helps.

- 891
- 4
- 19
-
-
-
Yes. I know the complete syntax and we need to write what we want to update inside {}. @Delwinn – Naim Hasan Pappu May 19 '22 at 14:10
-
I meant, type setState((){}) and check if the issue still persists (that it shows a red line once fully typed). Sometimes what happens is that it wont show in the auto-complete stuff but as soon as your write the whole piece of code, it understands – Delwinn May 19 '22 at 16:34
-
It understand when fully typed. But we faced the same issue when we need to override initState method. We have to type the whole body. Then when we type super. then it shows the initState method in list. It is causing more time on typing. @Delwin – Naim Hasan Pappu May 20 '22 at 03:45
-
It must be a project specific issue then. Check if you have flutter/dart package upgrade. Go to marketplace to check. Or try reinstalling Android Studio – Delwinn May 20 '22 at 10:49
-
Dart and Flutter plugins are latest and dart folder has latest files. Now we are switching to Artic Fox version (That was less buggy as far as we remember). @Delwinn – Naim Hasan Pappu May 20 '22 at 14:12
This apparently it is a change in the version of Android Studio (if you are working with Android Studio, by the way, neither setState nor initState nor several other methods work.
My current version of Android Studio is as follows
I did the downgrade and now everything works correctly. I would recommend using the version. Android Studio Arctic Fox (2020.3.1) Patch 2 You can find it in this link
Rolling back to the version of Android Studio Artic Fox, which was the one in which everything worked correctly before, maybe an older and more stable version also solved it too.

- 131
- 1
- 3