Skip to content

[animations] optimize open container opacity usage#2626

Merged
auto-submit[bot] merged 4 commits intoflutter:mainfrom
jonahwilliams:open_container_fix
Sep 21, 2022
Merged

[animations] optimize open container opacity usage#2626
auto-submit[bot] merged 4 commits intoflutter:mainfrom
jonahwilliams:open_container_fix

Conversation

@jonahwilliams
Copy link
Contributor

Replace Opacity with Visibility. On newer framework versions, visibility will be much faster as it does not create an opacity layer.
Replace manually animated opacity widgets with a FadeTransition. On newer framework versions, the opacity animated via fade transition has some performance enhancements for stable subtrees that do not apply to the regular opacity render object

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM modulo one comment

final NavigatorState navigator = tester.state(find.byType(Navigator));
navigator.pop();
await tester.pump();
await tester.pump();
Copy link
Member

Choose a reason for hiding this comment

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

Why the extra pump?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From offline discussion, we were previously looking up the wrong opacity.

);

// Regression test for https://github.com/flutter/flutter/issues/72238.
testWidgets(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was always grabbing the wrong opacity and never actually tested the issue in question

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 20, 2022
@auto-submit auto-submit bot merged commit bad3142 into flutter:main Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: animations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants