[Animations] Add support for custom shadows to OpenContainer (#62475)#11401
Open
moepanda wants to merge 1 commit intoflutter:mainfrom
Open
[Animations] Add support for custom shadows to OpenContainer (#62475)#11401moepanda wants to merge 1 commit intoflutter:mainfrom
moepanda wants to merge 1 commit intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for custom closedShadows and openShadows to the OpenContainer widget, enabling custom shadow animations during transitions. It also fixes a layout overflow in the example app by transitioning from a fixed height to minimum height constraints and includes new tests to verify shadow behavior. A review comment suggests conditionally wrapping the Material widget with DecoratedBox only when custom shadows are provided to avoid unnecessary widgets in the tree.
2f3b47b to
88d57a1
Compare
88d57a1 to
f6d83d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for custom
BoxShadowto theOpenContainerwidget. This allows developers to specifyclosedShadowsandopenShadowsto create more advanced and visually appealing transitions that go beyond the standard materialelevation._ExampleSingleTileby replacing the fixed height with responsive constraints, ensuring the example remains stable across different system font sizes and shadow distributions.Motivation
Currently,
OpenContaineronly supports a numericelevationproperty, which limits modern UI designs requiring colored or multi-layered shadows. This PR also refactors the internal rendering hierarchy to move the shadow decoration outside the clipping surface, fixing a legacy issue where custom shadows were clipped byMaterial.Issues
Fixes flutter/flutter#62475
Pre-Review Checklist
[animations]///).