Skip to content

Fix out-of-sync ExpansionPanel animation - #105024

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
morriskurz:fix_5848
Jan 6, 2023
Merged

auto-submit[bot] merged 9 commits into
flutter:masterfrom
morriskurz:fix_5848

Conversation

@morriskurz

Copy link
Copy Markdown
Contributor

Increases the height of the AnimatedContainer in the ExpansionPanel class to match the IconButton height. This has no immediate effect on the height of the ExpansionPanel header, but smoothes the expansion / shrinking animation. See following GIFs for a visual explanation.

Before

2022-05-31 13-48-54

After

2022-05-31 13-53-56

Fixes #5848.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • 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.
  • All existing and new tests are passing.

Thank you @TahaTesser for the working example, it made my life a lot easier!

@flutter-dashboard flutter-dashboard Bot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels May 31, 2022
@HansMuller
HansMuller requested a review from gspencergoog June 3, 2022 21:38

@gspencergoog gspencergoog left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, according to the Material Design 2 spec, the entire header is supposed to be 48 pixels high (i.e. kMinInteractiveDimension), including the expansion button.

It looks like when this component was authored, a padding of 16 was used around the expansion button, when it should have been 12. So instead of the changes you've made, I think the only thing that needs to change here is to make the padding on this line be 12 instead of 16, which will make them both be 48 pixels high by default.

Ideally, some of those "magic" numbers would be moved to the top of the file as constants, and we'd have a test that makes sure that the header and the collapse icon are both 48 pixels high.

@gspencergoog gspencergoog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Thanks for the PR!

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with nits 👍 Thanks for fixing this and for the gifs in the description!

@Hixie

Hixie commented Dec 14, 2022

Copy link
Copy Markdown
Contributor

@morriskurz Thanks for your contribution! It looks like this is almost ready to land but has a few very minor fixes needed first. Would you have the time to do those changes so we could land it?

@morriskurz

Copy link
Copy Markdown
Contributor Author

@Hixie @gspencergoog @justinmc Thank you for the reviews and the effort you put in - I implemented the suggestions and should be ready to go!

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍 . Thanks for fixing my nits. I will add the autosubmit label to this and it will land soon 🚀

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 6, 2023
@auto-submit
auto-submit Bot merged commit e0f89e7 into flutter:master Jan 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jan 7, 2023
stuartmorgan-g pushed a commit to flutter/packages that referenced this pull request Jan 9, 2023
* 6d7c507 Update docstring (flutter/flutter#118072)

* e0f89e7 Fix out-of-sync ExpansionPanel animation (flutter/flutter#105024)

* 0e55504 Roll Plugins from 320461910156 to 276cfd4b212d (2 revisions) (flutter/flutter#118099)

* 71f9207 33d7f8a1b Remove single view assumptions from `window.dart` (flutter-team-archive/engine#38453) (flutter/flutter#118069)

* 7ddf42e InteractiveViewer parameter to return to pre-3.3 trackpad/Magic Mouse behaviour (flutter/flutter#114280)
stuartmorgan-g pushed a commit to flutter-team-archive/plugins that referenced this pull request Jan 11, 2023
* 6d7c507 Update docstring (flutter/flutter#118072)

* e0f89e7 Fix out-of-sync ExpansionPanel animation (flutter/flutter#105024)

* 0e55504 Roll Plugins from 3204619 to 276cfd4 (2 revisions) (flutter/flutter#118099)

* 71f9207 33d7f8a1b Remove single view assumptions from `window.dart` (flutter-team-archive/engine#38453) (flutter/flutter#118069)

* 7ddf42e InteractiveViewer parameter to return to pre-3.3 trackpad/Magic Mouse behaviour (flutter/flutter#114280)
esouthren pushed a commit to esouthren/flutter that referenced this pull request Jan 15, 2023
* Increase minimum height of headerWidget in ExpansionPanel to smooth the animation.

Signed-off-by: Morris Kurz <[email protected]>

* Add regression tests that check for equal height of header elements in ExpansionPanel.

Signed-off-by: Morris Kurz <[email protected]>

* Clarify comment.

Signed-off-by: Morris Kurz <[email protected]>

* Reduce padding in ExpandIcon to 12px s.t. header height is 48px.

Signed-off-by: Morris Kurz <[email protected]>

* Update testcases to new header height (56px -> 48px).

Signed-off-by: Morris Kurz <[email protected]>

* Test for header height equal to 48px.

Signed-off-by: Morris Kurz <[email protected]>

* Change issue number to link in comment

* Add periods to comments

Signed-off-by: Morris Kurz <[email protected]>