-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Const constructor audit. #76162
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
Const constructor audit. #76162
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. 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. |
cc @HansMuller |
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
@@ -1561,7 +1562,7 @@ class DoNothingAction extends Action<Intent> { | |||
/// * [WidgetsApp.shortcuts], which defines the shortcuts to use in an | |||
/// application (and defaults to [WidgetsApp.defaultShortcuts]). | |||
class ActivateIntent extends Intent { | |||
/// Creates a const [ActivateIntent] so subclasses can be const. | |||
/// Creates ain intent that activates the currently focused control. |
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.
ain => an
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.
good catch, fixed
@@ -111,7 +111,7 @@ abstract class PreferredSizeWidget implements Widget { | |||
/// its preferred size. | |||
/// * [AppBar] and [TabBar], which implement PreferredSizeWidget. | |||
class PreferredSize extends StatelessWidget implements PreferredSizeWidget { | |||
/// Creates a widget that has a preferred size. | |||
/// Creates a widget that has a preferred size that the parent can query. |
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.
the parent => any ancestor
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.
How would someone other than a parent query it?
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've added some more docs here but i'm pretty sure "parent" is actually right here.
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.
My mistake, parent is fine.
Landing on green, please let me know if I'm wrong about the parent/ancestor thing and I'll fix in a subsequent PR. Thanks! |
Where possible this uses this boilerplate text instead of bespoke text that doesn't say anything more useful: ``` /// Abstract const constructor. This constructor enables subclasses to provide /// const constructors so that they can be used in const expressions. ```
This pull request is not suitable for automatic merging in its current state.
|
Where possible this uses this boilerplate text instead of bespoke text
that doesn't say anything more useful:
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.