Skip to content

Conversation

@TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented Dec 10, 2024

Fixes Deprecate unused ButtonStyleButton.iconAlignment property

Refactor done in #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

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Dec 10, 2024
@TahaTesser TahaTesser marked this pull request as ready for review December 10, 2024 13:02
Copy link
Contributor

@Piinks Piinks left a 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?

@TahaTesser
Copy link
Member Author

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 :)

@TahaTesser
Copy link
Member Author

TahaTesser commented Dec 12, 2024

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
I really tried to find some existing non-widget prop that are deprecated with dart fix so I can base this PR on it but couldn't find it such deprecation. It seems non-widget prop are deprecated without dart fix. If you have any instructions or an instance of such dart fix please share.

Good news is anyone extending ButtonStyleButton might not have a use case for this redundant prop and default dart fix automatically removes unused overrides.

@TahaTesser TahaTesser requested a review from Piinks December 12, 2024 12:55
Copy link
Contributor

@Piinks Piinks left a 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?

@TahaTesser
Copy link
Member Author

TahaTesser commented Dec 12, 2024

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.

@TahaTesser
Copy link
Member Author

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.

@Piinks
Copy link
Contributor

Piinks commented Dec 12, 2024

Ah ok thank you, just double checking.

this.statesController,
this.isSemanticButton = true,
@Deprecated(
'Remove this parameter as it is now ignored. '
Copy link
Contributor

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.

Copy link
Member Author

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.

@TahaTesser TahaTesser requested a review from Piinks December 13, 2024 20:21
Copy link
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:)

Copy link
Contributor

@Piinks Piinks left a 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!

@TahaTesser TahaTesser force-pushed the button_style_button_icon_alignment branch 4 times, most recently from b252c80 to 469fb63 Compare January 9, 2025 08:32
@TahaTesser TahaTesser force-pushed the button_style_button_icon_alignment branch from 469fb63 to ab159d7 Compare January 13, 2025 10:40
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 13, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jan 13, 2025
Merged via the queue into flutter:master with commit 1c147a2 Jan 13, 2025
103 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 13, 2025
@TahaTesser TahaTesser deleted the button_style_button_icon_alignment branch January 13, 2025 13:56
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 13, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 13, 2025
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
maheshj01 pushed a commit to maheshj01/flutter that referenced this pull request Jan 15, 2025
…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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
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
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate unused ButtonStyleButton.iconAlignment property

3 participants