-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Deprecate unused ButtonStyleButton.iconAlignment property
#160023
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
Deprecate unused ButtonStyleButton.iconAlignment property
#160023
Conversation
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.
Could we add a dart fix that just removes uses of this?
It's an abstract class that is implemented by the buttons. I never wrote a dart fix for an abstract class. I'll look into it :) |
@Piinks Good news is anyone extending ButtonStyleButton might not have a use case for this redundant prop and default |
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.
What about the subclasses? They inherit this property. Do ElevatedButton, FilledButton, OutlinedButton, and TextButton get an analyzer warning about the deprecation? Will a dart fix work for those instances?
They use the IconAlignment directly. They no longer depend on ButtonStyleButton.iconAlignment. This was added to ButtonStyleButton by mistake. I have removed the unnecessary reference in previous PR. |
|
Button classes use ButtonStyle customisation to get icon alignment similar to icon size and icon color. As a result, abstract ButtonStyleButton IconAlignment is now redundant. |
|
Ah ok thank you, just double checking. |
| this.statesController, | ||
| this.isSemanticButton = true, | ||
| @Deprecated( | ||
| 'Remove this parameter as it is now ignored. ' |
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.
Can we add more context to the message here? This should probably mention ButtonStyle and the styleFrom methods where folks can use this now.
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.
Great suggestion! I added a line about ButtonStyle.iconAlignment alternative and update version tag.
QuncCccccc
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:)
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 as well! Thank you!
b252c80 to
469fb63
Compare
469fb63 to
ab159d7
Compare
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…160023) Fixes [Deprecate unused `ButtonStyleButton.iconAlignment` property](flutter#159782) Refactor done in flutter#158503 makes `ButtonStyleButton.iconAlignment` redundant. In this PR I'm marking it as deprecated without migration guide. However, it may possible to remove it altogether. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter@864d4f5...72db8f6 2025-01-13 [email protected] Roll Packages from 6554751 to 3c3bc68 (16 revisions) (flutter/flutter#161515) 2025-01-13 [email protected] Update error message for when leading/trailing width exceeds `ListTile` width and add missing test (flutter/flutter#161091) 2025-01-13 [email protected] Deprecate unused `ButtonStyleButton.iconAlignment` property (flutter/flutter#160023) 2025-01-12 [email protected] Provide monitor information. (flutter/flutter#161359) 2025-01-11 [email protected] [android_engine_test] Remove background/foreground from surface texture trampoline test. (flutter/flutter#161441) 2025-01-11 [email protected] Remove some miscellaneous references to Cirrus. (flutter/flutter#161390) 2025-01-11 [email protected] add semantics role and tab (flutter/flutter#161260) 2025-01-10 [email protected] CupertinoSheetRoute (flutter/flutter#157568) 2025-01-10 [email protected] Update `TextEditingController.text` documentation to recommend against using it in production code (flutter/flutter#157769) 2025-01-10 [email protected] � [tool] Add a wirelessly connected device name as `displayName` (flutter/flutter#160497) 2025-01-10 [email protected] FixForward: method was renamed (flutter/flutter#161431) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes Deprecate unused
ButtonStyleButton.iconAlignmentpropertyRefactor done in #158503 makes
ButtonStyleButton.iconAlignmentredundant. In this PR I'm marking it as deprecated without migration guide. However, it may possible to remove it altogether.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.