Skip to content

perf: drop per-divider LayoutBuilder; resolve cross-axis upstream#133

Open
andyhorn wants to merge 1 commit into
mainfrom
remove-divider-layoutbuil
Open

perf: drop per-divider LayoutBuilder; resolve cross-axis upstream#133
andyhorn wants to merge 1 commit into
mainfrom
remove-divider-layoutbuil

Conversation

@andyhorn
Copy link
Copy Markdown
Owner

Summary

  • Closes Per-divider LayoutBuilder is redundant for most paths #119. Each divider built was wrapped in its own LayoutBuilder even though its main-axis size is constant (thickness + padding) and its cross-axis size is already fixed by the tight BoxConstraints the parent supplies.
  • Resolves the divider's cross-axis paint dimension upstream in ResizableContainer (using the outer LayoutBuilder's constraints) via a new resolveDividerCrossAxisSize(length, max) helper, and passes it to ResizableContainerDivider as a required crossAxisSize parameter. The inner LayoutBuilder and _getWidth/_getHeight helpers are gone.
  • Same per-arm semantics as before (pixelsmin(pixels, max), expandmax, ratiomax * ratio, shrink0); no public API change (ResizableContainerDivider is internal to src/).

Test plan

  • dart analyze clean
  • Full existing widget-test suite passes (very_good test)
  • New unit tests for the four arms of resolveDividerCrossAxisSize

🤖 Generated with Claude Code

The divider's main-axis size is constant (thickness + padding), and its
cross-axis size is already determined by the parent's tight constraints.
The inner LayoutBuilder just read back what the parent supplied, so
remove it and resolve the cross-axis paint dimension upstream in
ResizableContainer (the outer LayoutBuilder) before constructing the
divider widget.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

Per-divider LayoutBuilder is redundant for most paths

1 participant