Skip to content

Fix unbounded cross-axis stretch crash (#48)#50

Closed
RandalSchwartz wants to merge 1 commit into
pingbird:masterfrom
RandalSchwartz:fix-issue-48-unbounded-stretch-crash
Closed

Fix unbounded cross-axis stretch crash (#48)#50
RandalSchwartz wants to merge 1 commit into
pingbird:masterfrom
RandalSchwartz:fix-issue-48-unbounded-stretch-crash

Conversation

@RandalSchwartz

Copy link
Copy Markdown

This PR fixes a critical crash (Issue #48) where BoxyRow or BoxyColumn would fail with a "BoxConstraints forces an infinite height/width" error when:

  1. It is used inside an unbounded container (like a SingleChildScrollView or another Flex with MainAxisSize.min).
  2. It uses CrossAxisAlignment.stretch (which is the default for Boxy flex widgets).

The fix involves checking if the incoming cross-axis constraint is finite before attempting to set a tight infinite constraint on children when stretching. This matches Flutter's RenderFlex behavior where it falls back to non-stretching layout in unbounded dimensions.

Verified with a reproduction test case.

@RandalSchwartz RandalSchwartz left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing as this fix is included in the more comprehensive PR #51.

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.

1 participant