fix: include min/max in ResizableSize equality (#104)#127
Merged
Conversation
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>
a56078d to
14d5a17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ResizableSizePixels,ResizableSizeRatio, andResizableSizeExpand==/hashCodenow includeminandmax(previously only the primary field was compared)ResizableSizeShrinkgains its missing==/hashCodeoverrides (was falling back to identity)ResizableSize.pixels(0)to compare against the actual hidden-size constantResizableSize.pixels(0, min: 0, max: 0)Fixes the bug where
listEquals(oldWidget.children, widget.children)inresizable_container.dart:59failed to detect constraint changes, so the controller wouldn't relayout when onlymin/maxdiffered.Closes #104
Test plan
flutter test)min/maxdifferences andhashCodeconsistency🤖 Generated with Claude Code