feat: add hide/show methods to ResizableController#99
Merged
Conversation
Closes #92. Adds `hide`, `show`, `setHidden`, `isHidden`, and `hiddenIndices` to `ResizableController`. Hiding a child collapses it to zero size and omits its adjacent divider; the previous `ResizableSize` is remembered and restored on `show`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
IDE-style three-pane layout (Explorer / Editor / Outline) with AppBar buttons that toggle the left and right panels via setHidden, and a button that calls setSizes while one panel is hidden to demonstrate that the new size is applied when the panel is shown again. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous approach skipped the ResizableContainerDivider entirely for hidden-adjacent boundaries, which broke ResizableLayout's performLayout (it iterates children stride-2, assuming strict child/divider/.../child interleaving). Hiding a child then threw RangeError when sizes[i ~/ 2] over-indexed the sizes list. Now: always interleave child + divider in both layout and Flex branches. ResizableLayout takes a hiddenIndices set and lays out hidden-adjacent dividers with zero size; the Flex branch swaps them for SizedBox.shrink so they are invisible and non-interactive. The visual result is the same (no divider, no space taken) without breaking the layout loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The resize button used to overwrite all three panels' sizes, snapping the right panel back to 240px and clobbering any manual drag. Keep the center as expand so it absorbs the delta, and freeze the right panel at its current pixel size so the user's drag is preserved. Refs #103. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
hide,show,setHidden,isHidden, andhiddenIndicestoResizableController— collapses a child and its adjacent divider without removing it from the widget tree.ResizableSizeis remembered and restored when the child is shown again.setSizescalls while a child is hidden update the saved size but keep the child collapsed untilshowis called.setChildrenclears any hidden state.Closes #92.
Test plan
very_good testpasses (existing + new controller tests)dart analyzecleansetSizeswhile hidden, thenshow, restores the most recent set size🤖 Generated with Claude Code