fluttercommunity / backdrop

Backdrop implementation in flutter.
https://pub.dev/packages/backdrop
MIT License
336 stars 36 forks source link

Custom shape on the front layer #115

Closed milkyway044 closed 2 years ago

milkyway044 commented 2 years ago

It would be nice to be able to change the shape of the front layer. I have a design with beveled corners like in Shrine Material theme, but now there is no way to change shape.

Shrine's customized backdrop

The front layer of Shrine's backdrop uses a custom cut corner on the top left, giving the backdrop an asymmetrical shape.

milkyway044 commented 2 years ago

https://material.io/components/backdrop#theming

daadu commented 2 years ago

@WieFel I am surprised that this is not being implemented!

Should we generalise frontLayerBorderRadius to frontLayerShape ?? Or keep both?

I am in favour of only having frontLayerShape and deprecating frontLayerBorderRadius.

daadu commented 2 years ago

Looks non-trivial to just replace. frontLayerBorderRadius is used to "clip" as well - maybe to show scrim properly.

Check this code:

https://github.com/fluttercommunity/backdrop/blob/e623fb85a904035247e766b24faea80d8f198fac/lib/src/scaffold.dart#L544-L551

daadu commented 2 years ago

Ok, looks like we can do it "clipping" based on ShapeBorder with ShapeBorderClipper

daadu commented 2 years ago

@milkyway044 Request you to review and test against the PR for this feature.

WieFel commented 2 years ago

@WieFel I am surprised that this is not being implemented!

Me too actually!

Should we generalise frontLayerBorderRadius to frontLayerShape ??

Yes LGTM

milkyway044 commented 2 years ago

@milkyway044 Request you to review and test against the PR for this feature.

@daadu frontLayerShape is exactly what i need, thank you so much, guys!