Conversation
|
Shadows seem orthogonal to cilpping... shouldn't this just be a separate widget? |
I definitely thought about putting this into a new widget, but the options i came up with would either:
I was also looking at adding 'shadow' to the other Clippers but wanted to discuss how to go about it first. |
|
Why not just a widget that takes a Path and draws a shadow to match that Path? Come to think of it, does PhysicalShape address your need? |
|
Looks like PhysicalShape or PhysicalModel (for rect shapes) does exactly this? I am going to close this PR for now. Feel free to add additional details if this did not resolve your issue. |
|
@coman3 Could you solve this issue by using PhysicalShape or PhysicalModel as suggested? Because I could not find enough documentation and examples on those 2 classes. maybe you can help |
|
@aytunch I ended up just implmenting a wrapper widget locally. PhysicalShape or PhysicalModel did not have support for a custom shadow which was too limiting in my situation. If you need a basic shadow, and maybe some colour use PhysicalShape, otherwise have a look at this implementation: https://gist.github.com/coman3/e631fd55cd9cdf9bd4efe8ecfdbb85a7 |
Description
Adds non API breaking support for shadows to ClipPath.

Before:
After:

Related Issues
#25946 Add boxShadow to ClipPath
Tests
I added the following tests:
Append drawing shadow onto previous
ClipPath paintingtest: 4940e77I am unable to update the goldens for this, @Hixie can you please help me out?
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?