Repository navigation
feat: add IndexedStack control - #12
Merged
Merged
Conversation
Render Ruby indexed_stack as a design-neutral IndexedStack that keeps every child mounted, so typed text and scroll offsets survive switching. Out-of-range indexes clamp and hidden children keep their slot.
This was referenced Oct 28, 2026
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.
Adds the
IndexedStackcontrol (Work Package F, item F3). It shows one child at a time and keeps every child mounted, so a tab body keeps its typed text and scroll position when the user switches away and back. Hiding a child withvisibledrops its subtree, so it cannot do this.Ruby counterpart: AdamMusa/ruflet#29
Rendering
lib/src/controls/indexed_stack.dartis one design-neutral file that imports onlywidgets.dart, likerotated_box.dart. Material and Cupertino render the same thing: a FlutterIndexedStackwrapped inLayoutControl, so the common layout keywords work (expand,width,height,margin, ...).children("controls", visibleOnly: false). Each child is keyed by its control id. A hidden child keeps its slot as an empty box, soindexalways points at the same Ruby child.Wire keys
controlschildrenindexindex(clamped)alignmentalignmentAlignmentDirectional.topStartfitsizing(loose/expand/passthrough, same keyword as Stack)looseclip_behaviorclipBehaviorhardEdgeLayoutControlEvents: none apart from the common
on_animation_endandon_size_change. Enum strings accept camelCase or snake_case.Tests
test/widgets/ruby_indexed_stack_test.dart, 12 tests run on both iOS (Cupertino) and Android (Material). They check:alignment,fit: expand(child is forced to 200x100) andclip_behaviorare passed through;EditableTextState;verify_pr.shwith Flutter 3.41.2:flutter testgives +712: All tests passed! (baseline 695).flutter analyze lib testreports No issues found!. The wire-key audit shows 0 new findings.