Skip to content

fix: Handle a PostProcessComponent without positional children - #4183

Open
ufrshubham wants to merge 2 commits into
mainfrom
devkage/fix-post-process-empty-children
Open

ufrshubham wants to merge 2 commits into
mainfrom
devkage/fix-post-process-empty-children

Conversation

@ufrshubham

Copy link
Copy Markdown
Member

Description

PostProcessComponent threw Bad state: No element from onChildrenChanged whenever it had no PositionComponent children. That happened when its last child was removed, or when it was added with only non-positional children, such as a plain Component.

When there were no positional children, _recalculateBoundingSize set the size to zero but then kept going and called reduce on the empty list of child rects. It now returns after setting the size to zero.

Added tests for both cases.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • [-] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #4182

@ufrshubham ufrshubham self-assigned this Oct 31, 2026

This branch has not been deployed

No deployments
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 this pull request may close these issues.

PostProcessComponent throws StateError when it has no PositionComponent children

1 participant