Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart fix - Add the ability to replace a static method invocation with a const constructor. #49056

Open
darrenaustin opened this issue May 18, 2022 · 1 comment
Labels
analyzer-data-driven-fixes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@darrenaustin
Copy link

The Flutter team has a static function on MaterialStateProperty:

static MaterialStateProperty<T> all<T>(T value)

We would like to have a dart fix that will allow us to replace invocations of .all with a call to a constructor for a new class that implements MaterialStateProperty<T>:

const MaterialStatePropertyAll(this.value);

So instead of:

final color = MaterialStateProperty<Color>.all(Colors.blue);

We want:

const color MaterialStatePropertyAll<Color>(Colors.blue);

Looking at the docs for fixes, there doesn't appear to be a way to define this kind of transform. If possible this would be a nice feature for us.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request analyzer-data-driven-fixes labels May 18, 2022
@bwilkerson
Copy link
Member

@pq @keertip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-data-driven-fixes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants