Skip to content

Add dart fix support for moved classes  #45393

@Piinks

Description

@Piinks

We would like to supply fixes that can change a class name based on the method being called.

For example:

Scaffold.of(context).showSnackBar(SnackBar(content: Text('Snack')));

should be migrated to

ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Snack')));

The is not specific to the same method being moved across classes, as we would want to be able to identify and compose fixes that can feasibly migrate classA.methodA to classB.methodB, or constructors too.

Another example of this would be going from this:

BlackListingTextInputFormatter()

to this:

FilteringTextInputFormatter.deny()

Not sure if that example should be a different use case, if so we can break it out into a separate issue.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondevexp-dartfixIssues with the dartfix packagelegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions