Refactor flutter code not avilable in vs code

867

Solution 1

Place your cursor in the widget you want to edit and use CTRL + . shortcut to see the options. Use CMD + . for MacOS. To do it manually in VS Code.

And For Android Studio its option + return in Mac and Alt + Enter in Windows.

See this For A Reference

Solution 2

Turning dart lps analyzer off solved the problem for meenter image description here

Share:
867
Humayun
Author by

Humayun

Updated on December 26, 2022

Comments

  • Humayun
    Humayun over 1 year

    vs code suddenly not showing the refactoring option on any code on dart.. If I press ctrl+shift+R on any widget or class it says no refactoring enter image description hereavailable..

    • Randal Schwartz
      Randal Schwartz over 3 years
      Have you tried restarting your analysis server?
  • Humayun
    Humayun over 3 years
    Already found the solution, but thank you anyway.. this is the available solution for now..
  • wilk3ns
    wilk3ns about 3 years
    How did you solve the problem? I'm running to the exact same issue and the answer above is irrelevant
  • Pratik Jain
    Pratik Jain almost 2 years
    option + return does not work on Mac. I am using M1 Macbook Pro 2020 and this did not help in Android Studio!