Skip to content

fix: answer scroll_to on the Cupertino ReorderableListView - #15

Merged
AdamMusa merged 2 commits into
codex/engine-initializationfrom
feat/scroll-methods
Oct 29, 2026
Merged

AdamMusa merged 2 commits into
codex/engine-initializationfrom
feat/scroll-methods

Conversation

@AdamMusa

@AdamMusa AdamMusa commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Package A / A0 (scroll-methods). Ruby counterpart: AdamMusa/ruflet#31

What

The Ruby PR adds scroll_to to every scrollable control. The Dart scroll_to handler already exists in ScrollableControl. While testing it on both designs I found that the Cupertino ReorderableListView never wrapped its list in ScrollableControl. So on iOS/macOS:

  • scroll_to found no invoke listener and failed with TimeoutException: Timeout waiting for invoke method listener.
  • auto_scroll and scroll were ignored.

This PR wraps the Cupertino list exactly like the Material renderer does, using the same _controller.

Ruby usage

chat = list_view(expand: true, controls: messages)
chat.scroll_to(offset: -1, duration: 250, curve: "easeOut")
todos = reorderable_list_view(controls: items)
todos.scroll_to(delta: 120)

Wire

Invoke scroll_to with args offset (negative counts from the end), delta, scroll_key, duration (ms) and curve. These are unchanged; no new props or events.

Material vs Cupertino

  • Material: unchanged.
  • Cupertino: ReorderableList is now wrapped in ScrollableControl, so it shows a CupertinoScrollbar when scroll is set and answers scroll_to/auto_scroll. No Material widget is involved.

Tests

New test/widgets/ruby_scroll_methods_test.dart, run on iOS and Android for ListView, GridView, Column (scroll), Row (scroll) and ReorderableListView. For each it checks:

  • offset → 120
  • delta → 150
  • offset: -1 → max extent
  • an animated duration/curve passes through intermediate offsets and ends at 0

The invoke helper fails fast instead of hanging when no listener answers. Before this fix, iOS: ReorderableListView failed with the listener timeout. 10/10 pass now.

verify_pr.sh (Flutter 3.41.2):

  • engine flutter test +705: All tests passed! (baseline 695 + 10 new)
  • flutter analyze lib test: No issues found!
  • ruflet_core 146/146 files, 624 runs
  • wire-key audit: NEW vs baseline: 0

The Cupertino renderer never wrapped its list in ScrollableControl, so a
Ruby scroll_to on iOS/macOS waited for a listener until it timed out and
auto_scroll/scroll were ignored. Wrap it like the Material renderer and
cover scroll_to for every scrollable control on both designs.
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.

1 participant