-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Arrow syntax for getters #156483
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
Arrow syntax for getters #156483
Conversation
dev/integration_tests/new_gallery/lib/demos/material/picker_demo.dart
Outdated
Show resolved
Hide resolved
examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart
Outdated
Show resolved
Hide resolved
| return false; | ||
| } | ||
| } | ||
| bool get _isOnDesktopAndWeb => kIsWeb || switch (defaultTargetPlatform) { |
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.
This looks incorrect based on the name.. should this be true only iff it is desktop && web?
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.
To be clear, I am wondering if the original logic was incorrect to begin with.
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.
Absolutely: either the logic should be changed to use && or the getter should be renamed to _isOnDesktopOrWeb.
I could change it now, though perhaps that's outside the scope of this PR.
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.
Yeah definitely something to follow up on separately.
packages/flutter_tools/lib/src/build_system/targets/deferred_components.dart
Outdated
Show resolved
Hide resolved
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
|
Rebasing should fix the failing check. |
7744e74 to
d16ee4a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
Yes, please! More of this! |
This egotistical PR aims to draw attention to a style guideline that I changed:
There was an opportunity for valuable discussion in #154753 about how this structure affects readability, but I shut it down pretty quick since there was a lot of other stuff going on there.
Interested to hear thoughts from @Piinks and others.