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

The child provided to decorator functions is larger than it should be #201

Closed
benthillerkus opened this issue May 9, 2024 · 3 comments
Closed
Labels
bug Something isn't working in triage

Comments

@benthillerkus
Copy link
Contributor

benthillerkus commented May 9, 2024

Bug report

Describe the bug

With the decorator argument on WoltModalSheet.show you can provide a Widget tree in which the modal sheet will essentially be embedded as a child.
I want to use the decorator to add a blurred background to the sheet.
Unfortunately, the child provided to the decorator function is always as large as maxPageHeight, so when I wrap it with a BackdropFilter and a ClipRRect, I will essentially have a large blank blurred space on top of my sheet if the sheet resizes itself to be smaller than maxPageHeight.

Screenshot 2024-05-09 at 21 52 49

Steps to reproduce

...
WoltModalSheet.show(
  ...
  decorator: (child) {
    return Align(
      alignment: Alignment.bottomCenter,
      child: ClipRRect(
        ...
        child: BackdropFilter(
          ...
          child: child,
        )
      )
    )
  }
  ...
)

Expected behavior

I'd expect child to be only as large as the area that it paints with content.

@benthillerkus benthillerkus added bug Something isn't working in triage labels May 9, 2024
@benthillerkus
Copy link
Contributor Author

Oh, no, looking at the code, I think this is because CustomMultiChildLayout just always takes as much space as it can get, right?

I think fixing this would require using CustomBoxy from the boxy package, because with that layout widget, you can actually have the size of the parent depend on the size of the children.

@benthillerkus
Copy link
Contributor Author

benthillerkus commented May 9, 2024

That or, move the decorator function to wrap a smaller part of the tree, ie a part that is being laid out by the CustomMultiChildLayout

@ulusoyca
Copy link
Collaborator

Thanks for the contribution and the PR 💙 Closing this since your PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in triage
Projects
None yet
Development

No branches or pull requests

2 participants