Code Action: Generate Interface #44645
Labels
area-devexp
For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
devexp-refactoring
Issues with analysis server refactorings
P4
type-enhancement
A request for a change that isn't a bug
dart --version
)2.12.0-133.2.beta on windows_x64
Problem
Oftentimes I write some kind of service and afterwards I want to create an abstract class from it, to implement dependency inversion. I always have to manually copy the whole class and delete the function bodies, which is annoying work.
Possible solution
A code action would be great. Like I can do "extract widget" in flutter, I'm thinking of a code action like "generate Abstract Class" or "generate Interface" when hovering over a dart class. The action should then create an abstract class (and maybe let me chose the name) which acts as an interface.
Example
existing class
class MyClass { void helloWorld(){ print("Hello"); } }
generated class after code action:
abstract class MyAbstractClass { void helloWorld(); }
The text was updated successfully, but these errors were encountered: