Repository navigation
feat: add custom_scroll_view and sliver children - #35
Merged
Merged
Conversation
Add CustomScrollView (custom_scroll_view) with the sliver child types sliver_list, sliver_grid, sliver_to_box_adapter and sliver_fill_remaining. Lists and grids accept a header that can stay pinned (sticky_header), slivers come from slivers: or from block children, and sliver children only accept key, data, visible and their own keywords. Registered in both CLASS_MAP files and the three DSL helper files with both spellings.
This was referenced Oct 28, 2026
Merged
2 tasks
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.
What
Adds
custom_scroll_viewand its sliver children:sliver_list,sliver_grid,sliver_to_box_adapterandsliver_fill_remaining(SPEC E1). A page can now mix lists, grids, boxes and sticky section headers in one scroll view.Engine counterpart (renderer): AdamMusa/ruflet-engine#20
Usage
Block form (children land in
controls, which the renderer reads whensliversis absent):Any non-sliver control placed in
sliversscrolls as a single box. To add items, mutate a sliver's children and callpage.update. The patch targets that sliver only.Wire keys
CustomScrollView(custom_scroll_view,customscrollview;shared/customscrollview_control.rb):sliverscontrols(block children)horizontal(defaultfalse)reverse(defaultfalse)anchorcache_extentclip_behaviorsemantic_child_countkeyboard_dismiss_behavior("manual"|"onDrag")scroll,auto_scroll,scroll_intervalon_scrollSliver children carry only
key data visibleplus their own keys. Box layout keywords such aswidth,expandandmarginraiseArgumentError:sliver_list(children = nil, **, &block)SliverListcontrols,spacing(0),divider_thickness(0),item_extent,padding,build_controls_on_demand(true),header,sticky_header(false),bgcolorsliver_grid(children = nil, **, &block)SliverGridcontrols,runs_count(1),max_extent,spacing(10),run_spacing(10),child_aspect_ratio(1.0),padding,header,sticky_header(false),bgcolorsliver_to_box_adapter(content = nil, **)SliverToBoxAdaptercontentsliver_fill_remaining(content = nil, **)SliverFillRemainingcontent,has_scroll_body(false: Ruflet content is box content, not a nested scrollable),fill_overscroll(false)All are registered in both CLASS_MAP files, the material control methods, the shared forwarders and
Ruflet::DSL.Material vs Cupertino
The scroll view and its slivers are design-neutral. iOS gets bouncing physics. Sticky headers use widgets-layer
PinnedHeaderSliverinsideSliverMainAxisGroupon both designs, and no Material widget is built on iOS. See the engine PR for the rendering details.Gotchas
page.padding = 0. The view needs a bounded height, for exampleexpand: truein the page column.sliver_*controls outside acustom_scroll_viewshow the generic unknown-control error. This is intended (D-3).sliver_fill_remainingwith a ListView or GridView inside needshas_scroll_body: true.controls:or nested blocks.Not in this PR
on_refresh/refresh_*/on_end_reached/end_reached_thresholdare a follow-up once Package A'sfeat/pull-to-refreshandfeat/end-reachedmerge. Those PRs are not open yet; only A0 (feat/scroll-methods: ruflet feat: add scroll_to to scrollable controls #31, ruflet-engine Dev #15) is.scroll_tomethod:include ScrollableMethodsfor a Rubycustom_scroll_view.scroll_to(...)waits for A0 (ruflet feat: add scroll_to to scrollable controls #31,feat/scroll-methods). Until then, usepage.invoke(view, "scroll_to", args: { "offset" => -1 }). The renderer already handles it.Tests
test/custom_scroll_view_compatibility_test.rb(11 tests) covers:controlscontrol(:sliver_list)ArgumentErrorfor box keywords on slivers and for unknown keywords or eventspage.updatepatches only the changedsliver_listscrollevent dispatchteam/verify_pr.sh(engine + Ruby worktrees): PASSflutter test(Flutter 3.41.2): +720, all passed (baseline 695 + 20 focused + 5 matrix)flutter analyze lib test: No issues foundcustom_scroll_view.dartandsliver_children.dart. They are not new findings.