scroll_spy 0.2.7
scroll_spy: ^0.2.7 copied to clipboard
Compute focused items and a stable primary item in a scrollable viewport (feed/autoplay/analytics).
0.2.7 — 2025-12-24 #
Release automation maintenance (no API changes).
Changed #
- Improved tag-based publishing automation.
- Cleaned up repo workflow documentation (canonical guide).
0.2.6 — 2025-12-23 #
Maintenance release with separated-list index mapping fixes and tooling cleanup.
Added #
findItemIndexCallbacksupport forScrollSpyListView.separated.- Test coverage for separated list index mapping.
Fixed #
- Correct item-to-child index mapping for separated lists.
- Eliminated deprecated
findChildIndexCallbackwarnings on newer Flutter SDKs.
Changed #
- Refreshed the example app.
0.2.5 — 2025-12-20 #
Docs-only release removing the oversize demo screenshot entry.
Changed #
- Removed the demo GIF from pubspec screenshots to satisfy pub.dev limits.
0.2.4 — 2025-12-20 #
Docs-only release with header polish and naming update.
Changed #
- Updated the README title to ScrollSpy.
- Refined the README header layout with a linked demo preview.
0.2.3 — 2025-12-20 #
0.2.2 — 2025-12-20 #
Docs-only release with refreshed preview media.
Changed #
- Updated demo gif.
- Adjusted README preview sizing.
0.2.1 — 2025-12-20 #
Insets-aware viewport support plus metrics filtering.
Added #
viewportInsetsandinsetsAffectVisibilityonScrollSpyScopeand all wrapper widgets.metricsNotificationPredicateto filterScrollMetricsNotificationsignals.- Geometry guard to skip entries from mismatched viewports (nested scrollables safety).
- Tests for viewport insets + metrics predicate behavior.
Changed #
- Focus anchor and region evaluation now use the effective (insets-deflated) viewport.
- Debug overlay now visualizes the effective viewport bounds by default.
0.2.0 — 2025-12-20 #
Performance-focused release with low-overhead per-item signals for large feeds.
Highlights #
- Per-item boolean notifiers for primary/focused/visible state.
ScrollSpyItemLiteto rebuild only when those booleans toggle.- Builder/listener widgets for boolean signals (no rebuild when unchanged).
Added #
ScrollSpyController.itemIsPrimaryOf(id).ScrollSpyController.itemIsFocusedOf(id).ScrollSpyController.itemIsVisibleOf(id).ScrollSpyItemLite<T>.ScrollSpyItemPrimaryBuilder/ScrollSpyItemFocusedBuilder/ScrollSpyItemVisibleBuilder.ScrollSpyItemPrimaryListener/ScrollSpyItemFocusedListener/ScrollSpyItemVisibleListener.
Changed #
- Per-item notifier updates now iterate tracked listeners (O(listeners)) and use diff-based updates for boolean signals (behavior unchanged).
0.1.0 — 2025-12-19 #
Initial public release of scroll_spy.
Highlights #
- Compute focused items plus a single stable primary winner.
- Configurable focus region, selection policy, stability, and update cadence.
- Debug overlay for visualizing region, bounds, and per-item metrics.
- Convenience wrappers and builders for rapid integration.
Added #
- Focus engine that computes focused items and a single stable primary item.
ScrollSpyScope<T>to observe a scrollable subtree.ScrollSpyItem<T>for per-item registration + focused/primary rebuild isolation.ScrollSpyController<T>exposingprimaryId,focusedIds,snapshot, anditemFocusOf(id).- Focus regions:
line(anchor + optional thickness)zone(anchor +extentPx)custom(anchor + evaluator)
- Primary selection policies:
closestToAnchorlargestVisibleFractionlargestFocusOverlaplargestFocusProgresscustomcomparator
- Stability controls:
hysteresisPxminPrimaryDurationpreferCurrentPrimaryallowPrimaryWhenNoItemFocused
- Update policies:
perFrameonScrollEnd(debounced)hybrid(drag per-frame + throttled ballistic + final settle)
- Debug overlay (optional):
- focus region visualization
- primary/focused outlines
- optional labels
- optional rect inclusion (debug-only)
- Diagnostics hook:
ScrollSpyDiagnostics. - Convenience wrappers:
ScrollSpyListView/ScrollSpyGridView/ScrollSpyCustomScrollView/ScrollSpyPageView
- Builder/listener utilities:
ScrollSpyPrimaryBuilder/ScrollSpyPrimaryListenerScrollSpyFocusedIdsBuilderScrollSpySnapshotBuilderScrollSpyItemFocusBuilder
Notes #
- For best performance, keep the debug overlay disabled in release builds.
- When using nested scrollables, configure
notificationDepth/notificationPredicateto filter signals.
