Skip to content

const_finder is not finding all const instances #51800

@dnfield

Description

@dnfield

In particular, it's missing static const List, Map, and Set initializers.

e.g.:

class Blah {
  static const List<int> ints = [1, 2]; // not found by const_finder
}

Which means --tree-shake-icons will drop things for you if you dos omething like

class Blah {
  static const List<Widget> icons = <Widget>[Icon(Icons.email), ...];
}

@alexmarkov has helped me find some missing things with the const finder implementation for this. Currently testing a fix.

Metadata

Metadata

Assignees

Labels

dependency: dartDart team may need to help usengineflutter/engine related. See also e: labels.toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions