Skip to content

fix: include min/max in ResizableSize equality (#104)#127

Merged
andyhorn merged 1 commit into
mainfrom
fix-resizable-size-equali
May 27, 2026
Merged

fix: include min/max in ResizableSize equality (#104)#127
andyhorn merged 1 commit into
mainfrom
fix-resizable-size-equali

Conversation

@andyhorn
Copy link
Copy Markdown
Owner

Summary

  • ResizableSizePixels, ResizableSizeRatio, and ResizableSizeExpand == / hashCode now include min and max (previously only the primary field was compared)
  • ResizableSizeShrink gains its missing == / hashCode overrides (was falling back to identity)
  • Updates two stale controller tests that compared the hidden-child size against ResizableSize.pixels(0) to compare against the actual hidden-size constant ResizableSize.pixels(0, min: 0, max: 0)

Fixes the bug where listEquals(oldWidget.children, widget.children) in resizable_container.dart:59 failed to detect constraint changes, so the controller wouldn't relayout when only min/max differed.

Closes #104

Test plan

  • All 139 existing + new equality tests pass (flutter test)
  • Added equality tests for all four subclasses covering min/max differences and hashCode consistency

🤖 Generated with Claude Code

ResizableSizePixels, ResizableSizeRatio, and ResizableSizeExpand only
compared their primary field in == and hashCode, and ResizableSizeShrink
had no overrides at all. This caused listEquals on widget.children to
miss constraint changes and skip relayout.

Include min/max in == and hashCode for all four subclasses, add the
missing overrides on Shrink, and update the controller test's hidden-
size assertion to compare against the actual hidden-size constant.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@andyhorn andyhorn force-pushed the fix-resizable-size-equali branch from a56078d to 14d5a17 Compare May 27, 2026 13:48
@andyhorn andyhorn enabled auto-merge (squash) May 27, 2026 13:48
@andyhorn andyhorn merged commit 72c28ae into main May 27, 2026
1 check passed
@andyhorn andyhorn deleted the fix-resizable-size-equali branch May 27, 2026 13:49
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.

ResizableSize equality ignores min/max (and Shrink lacks equality)

1 participant