Thi Hoang
Thi Hoang

Reputation: 87

Android Studio Flutter auto-suggestion does not show up for override methods

I am not able to override initState() or any other methods by simply typing its name and waiting for auto-suggestion. The IDE just says No suggestions (first image), but Ctrl + O does the job normally (2nd image).

enter image description here

enter image description here

I tried flutter clear, flutter pub get, upgrade flutter, dart, plugins... also turning off Power Save Mode, Invalidate caches... but the problem is still not solved.

Please tell me a way to do this just by typing the methods name, without opening the "Choose Methods to Override menu" and then clicking to select.

Upvotes: 1

Views: 2038

Answers (4)

amit.flutter
amit.flutter

Reputation: 1141

i have try all above solution and i have flutter 3.10.6 but non of work

Remove flutter, dart and other snippets package from android studio

from file->invalid cache-> restart

reinstall all plugins.

Now it's working properly

Upvotes: 0

Pourqavam
Pourqavam

Reputation: 80

This was a bug in Flutter 3.0.0 and fixed in Flutter version 3.0.2:

https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel#302-june-10-2022

But there is still a suggestion bug for setState method:

https://github.com/dart-lang/sdk/issues/49233

Upvotes: 2

Robert
Robert

Reputation: 11

I have same problem, tried all day just to figure out the solution and i found that the problem is with the android studio, reverting it back to flutter version 2.10.5 solve the problem.

VS code work well with flutter v3.0 but i am more comfortable working with AS, so until AS update/fix the problem i will stick with the older version.

Upvotes: 1

dhruvi
dhruvi

Reputation: 51

Sometimes is not generate Properly so try to create with type st and select option from tips menu and then write your class name then it should work.flutter clean also work in my case.

Upvotes: 0

Related Questions