Skip to content

refactor(superdeck): follow the active slide with a plain ListView - #127

Merged
leoafarias merged 2 commits into
refactor/vendor-syntax-highlightfrom
refactor/replace-stale-widget-deps
Sep 23, 2026
Merged

leoafarias merged 2 commits into
refactor/vendor-syntax-highlightfrom
refactor/replace-stale-widget-deps

Conversation

@leoafarias

Copy link
Copy Markdown
Collaborator

Intent

Stack 3/8, based on #126. It drops scrollable_positioned_list from superdeck without changing how the thumbnail panel follows the active slide.

Why: scrollable_positioned_list hasn't had a release since May 2023, and the panel used its position listener to call setState on every scroll change, rebuilding the panel while you scroll.

Scroll-to-index is preserved. Every thumbnail has the same extent: AspectRatio(kAspectRatio) plus a fixed margin and border, and selection only scales it. So the list's scroll extent is exact, and any slide's offset follows from its index, even when it's far away and not built yet. The movement rules are the same as before:

  • stay put when the active thumbnail is fully visible
  • align to the nearer edge when it's cut off
  • land a slide that's ahead of the view at 70% of the viewport, and one that's behind it at the leading edge
  • same curve and duration, in both scroll directions

Commits

  1. test(superdeck): 8 tests, run first against the old implementation, where they pass. They cover jumping forward or back to a far slide, stepping to the next slide, and not scrolling when the slide is already visible, each in vertical and horizontal mode.
  2. refactor(superdeck): ListView.builder plus a ScrollController. The dependency is removed and the change is noted in CHANGELOG.

Not changed: qr_flutter

I planned to replace qr_flutter too, since it was last released in 2023 and holds qr at 3.x. I dropped that. pdf → barcode 2.2.9 (its latest release) also requires qr ^3, so qr 4 can't be used in this workspace either way, and qr_flutter has no native code and causes no problems.

Impacted packages

superdeck.

Commands run

  • fvm dart analyze --fatal-infos in superdeck and demo: no issues.
  • fvm flutter test in superdeck: 784 passing (the previous 776 plus the 8 new tests).
  • fvm dart run melos run test:integration:macos --no-select: 39 passing (the demo app, including thumbnail navigation).

Jumping forward or back to a far slide, stepping to the next one, and staying put when the slide is already in view, in both scroll directions.
scrollable_positioned_list has not been released since 2023, and the panel used its position listener to call setState on every scroll. Thumbnails share one extent, so the list's scroll extent is exact and a slide's offset follows from its index; animate to it with the same rules: stay put when fully visible, align to the nearer edge when cut off, and land ahead-of-view slides at 70% of the viewport.
@leoafarias
leoafarias added this pull request to stack #128 September 23, 2026 03:37
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit d5b3a44):

https://superdeck-dev--pr127-refactor-replace-sta-0l3s911u.web.app

(expires Fri, 23 Oct 2026 03:39:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9

@leoafarias
leoafarias merged commit 5515fde into main Sep 23, 2026
5 checks passed
@leoafarias
leoafarias deleted the refactor/replace-stale-widget-deps branch September 23, 2026 04:26
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