-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Prepare flutter_gallery for use_super_parameters
#100515
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Gold has detected about 1 new digest(s) on patchset 1. |
8bf9be5 to
93c3581
Compare
|
test-exempt: code refactor with no semantic change |
93c3581 to
a7b33dc
Compare
Piinks
left a comment
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.
LGTM with musings. :)
| assert(sectionIndex >= 0 && sectionIndex < sections.length), | ||
| assert(selectedIndex.value! >= 0.0 && selectedIndex.value! < sections.length.toDouble()), | ||
| super(key: key, listenable: selectedIndex); | ||
| super(listenable: selectedIndex); |
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.
Oh this is interesting, if the names do not match you can't use the super shorthand... but listenable would not make sense as a parameter here.
| class _TappableWhileStatusIs extends StatefulWidget { | ||
| const _TappableWhileStatusIs( | ||
| this.status, { | ||
| Key? key, |
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 see some of these end up with no key instead of super.key. Why is that?
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.
These are private widgets and the key parameter is unused. The unused_element lint would trigger here if super.key were to be used.
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.
So clean! Lints are the future. 🤖
#100575
Once all code in the repo has been migrated, we can turn on the
use_super_parameterslint.