Conversation
There was a problem hiding this comment.
Code Review
This pull request opts out of icon tree shaking for RFW by adding ignore comments for the non_const_argument_for_const_parameter lint. This is necessary because RFW creates IconData instances with dynamic data, which is incompatible with the new @mustBeConst annotations on IconData parameters. The change is correct in principle, but it seems to be missing an ignore for the matchTextDirection parameter, which is also marked as @mustBeConst.
| icon, | ||
| // ignore: non_const_argument_for_const_parameter | ||
| fontFamily: source.v<String>([...key, 'fontFamily']), | ||
| matchTextDirection: source.v<bool>([...key, 'matchTextDirection']) ?? false, |
There was a problem hiding this comment.
It seems you've missed adding an ignore for the matchTextDirection parameter. According to the Flutter PR you linked, matchTextDirection is also annotated with @mustBeConst. Since the value passed here is not a compile-time constant, it will also trigger the non_const_argument_for_const_parameter lint and should be ignored.
| matchTextDirection: source.v<bool>([...key, 'matchTextDirection']) ?? false, | |
| // ignore: non_const_argument_for_const_parameter | |
| matchTextDirection: source.v<bool>([...key, 'matchTextDirection']) ?? false, |

We are introducing the
@mustBeConstannotation onIconDataparameters that must be const in order for the icon tree shaker to work:IconData's constructor parameters as@mustBeConstflutter#181344IconDatafinaland@mustBeConstflutter#181345RFW does not support tree-shaking.
This PR adds the lint ignores with an explicit comment that the lint ignore is intentional.