Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom shape on the front layer #115

Closed
milkyway044 opened this issue Jan 5, 2022 · 7 comments · Fixed by #116
Closed

Custom shape on the front layer #115

milkyway044 opened this issue Jan 5, 2022 · 7 comments · Fixed by #116

Comments

@milkyway044
Copy link

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
Copy link
Author

@milkyway044 milkyway044 changed the title Custom cut corner on the front layer Custom shape on the front layer Jan 5, 2022
@daadu
Copy link
Member

daadu commented Jan 5, 2022

@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
Copy link
Member

daadu commented Jan 5, 2022

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

Check this code:

Widget _buildFrontPanel(BuildContext context) {
return Material(
color: widget.frontLayerBackgroundColor,
elevation: widget.frontLayerElevation,
borderRadius: widget.frontLayerBorderRadius,
child: ClipRRect(
borderRadius: widget.frontLayerBorderRadius,
child: Stack(

@daadu
Copy link
Member

daadu commented Jan 5, 2022

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

@daadu
Copy link
Member

daadu commented Jan 5, 2022

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

@WieFel
Copy link
Collaborator

WieFel commented Jan 5, 2022

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

Me too actually!

Should we generalise frontLayerBorderRadius to frontLayerShape ??

Yes LGTM

@milkyway044
Copy link
Author

milkyway044 commented Jan 5, 2022

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants