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

BoxShadow on front layer #126

Open
WieFel opened this issue Mar 5, 2023 · 3 comments
Open

BoxShadow on front layer #126

WieFel opened this issue Mar 5, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@WieFel
Copy link
Collaborator

WieFel commented Mar 5, 2023

In my app, due to the chosen colors, the front- and back layer are not very clearly distinguishable. Therefore, I would like to introduce a BoxShadow on the front layer.

If I change the existing frontLayerElevation on BackdropScaffold, it doesn't seem to have any effect on shadow.
immagine
I would expect the shadow to show on top of the front layer, but it is by default showing below it, where it is not visible.

@daadu do you think we could add that? I will prepare a PR...

@WieFel WieFel added the enhancement New feature or request label Mar 5, 2023
@daadu
Copy link
Member

daadu commented May 20, 2023

Are you sure that higher values of frontLayerElevation is not working? Can you share screenshot?

@WieFel
Copy link
Collaborator Author

WieFel commented Jun 17, 2023

The minimal example with frontLayerElevation: 8 gives just an unchanged UI:

MaterialApp(
  home: BackdropScaffold(
    frontLayerElevation: 8,
    appBar: BackdropAppBar(
      title: const Text("Backdrop Example"),
    ),
    backLayer: const Center(
      child: Text("Back Layer"),
    ),
    frontLayer: const Center(
      child: Text("Front Layer"),
    ),
  ),
)

image

If I additionally set the frontLayerBackgroundColor to Colors.transparent, then I can see something happening:
image
If I now set the elevation e.g. to 1:
image
The shadow gets less blurred, which means the elevation is applied correctly actually.

So, when my front layer is white, the shadow is hidden below it, because the shadow is displayed (like always in Material Design) on the bottom-right of the widget.

My goal would be to have the possibility for setting the shadow offset to be e.g. Offset(0, -4) in order to show the shadow on top of the front layer.

@daadu
Copy link
Member

daadu commented Jun 18, 2023

Ok, if you think so it is required then do it.

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

No branches or pull requests

2 participants