Repository navigation
Fix out-of-sync ExpansionPanel animation - #105024
Conversation
…he animation. Signed-off-by: Morris Kurz <[email protected]>
…n ExpansionPanel. Signed-off-by: Morris Kurz <[email protected]>
Signed-off-by: Morris Kurz <[email protected]>
There was a problem hiding this comment.
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.
Signed-off-by: Morris Kurz <[email protected]>
Signed-off-by: Morris Kurz <[email protected]>
Signed-off-by: Morris Kurz <[email protected]>
justinmc
left a comment
There was a problem hiding this comment.
LGTM with nits 👍 Thanks for fixing this and for the gifs in the description!
|
@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? |
|
@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
left a comment
There was a problem hiding this comment.
LGTM 👍 . Thanks for fixing my nits. I will add the autosubmit label to this and it will land soon 🚀
* 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)
* 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)
* 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]>

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
After
Fixes #5848.
Pre-launch Checklist
///).Thank you @TahaTesser for the working example, it made my life a lot easier!