-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[file_selector] Annotate all parameters of XTypeGroup with // ignore: prefer_const_literals_to_create_immutables #6499
[file_selector] Annotate all parameters of XTypeGroup with // ignore: prefer_const_literals_to_create_immutables #6499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't looked at the details of what was still failing. These don't need an ignore, you can just add the consts now since everything that generates this lint warning has a const constructor already.
Hi Stuart, do you think it would be a better approach to use const parameters instead of ignoring the warnings? Then, the desired change it's going to look like this: final XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: const <String>['jpg', 'jpeg'],
mimeTypes: const <String>['image/png'],
webWildCards: const <String>['image/*'],
); Since the PR that updates the constructor hasn't been merged yet, it won't be OK to use a const constructor at this moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we should just do it that way since we'd need to make that change regardless, but I guess once we make XTypeGroup
's construction const
we won't need the sub-const
s. So that would be more churn, not less; sorry about that.
LGTM with the temporary ignores.
@ditman Can you do the secondary approval here? |
…// ignore: prefer_const_literals_to_create_immutables (flutter/plugins#6499)
… prefer_const_literals_to_create_immutables (flutter#6499)
… prefer_const_literals_to_create_immutables (flutter#6499)
Annotate all parameters of XTypeGroup with // ignore: prefer_const_literals_to_create_immutables to prepare this implementation for the const constructor of XTypeGroup. On files that have more than two occurrences, an ignore_for_file was added at the top of the file.
Issue:
#111906 [file_selector]
XTypeGroup
should be immutableRelated PR:
[file_selector] Convert XTypeGroup to const
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.