hit 1.2.3
hit: ^1.2.3 copied to clipboard
Decouple Flutter layout size from hit-test size, and deliver taps outside parent bounds.
1.2.3 #
- Harden DevTools / debug paths for profile and release:
kDebugModeguards on service-extension registration and snapshot/probe APIs; assert-strip DevTools init and deferred debug paint from creation/paint hot paths; lazy debug-paint signal so release builds allocate no debug notifier. - Remove scroll-forced debug repaint listeners from
HitScope/SliverHitScope; deferred overlays track scroll viaLayerLinkLeader/Follower only.
1.2.2 #
- Reorganize README for a beginner-first path: install → quick start → common mistakes → patterns → API / debugging / migration.
1.2.1 #
- Add
debugPaintHitAreas— when enabled (or when Flutter'sdebugPaintSizeEnabled/ DevTools Debug Paint is on),HitLayerand deferred targets paint a dashed overlay of their real hit-test bounds, including overflow regions drawn fromHitScope/SliverHitScope. - Deferred hit-area debug overlays track
paintChild/ scroll via compositedLeaderLayer/FollowerLayer(HitDeferRegistration.hitDebugLeaderLink), matchingHitDeferPaint.onToppaint tracking. - Debug paint / DevTools paths are assert-gated: release and profile builds never enable overlays or debug compositing.
- Add a DevTools extension (
extension/devtools) with:- remote toggle for hit-area overlays and Select mode
- hierarchical Hit Scope Tree (
TreeView) of scopes and targets - Hit Layer Details + Hit Analysis panels
- tap a debug-painted hit area in the app (Select mode) to jump/highlight
the matching tree node (
Hit.selectedextension event) and open the widget call site in the IDE (Widget InspectornavigateToolEvent) - point probe (“why did this miss?”) and yellow target highlight
- Service extensions register automatically in debug when a
HitScope,HitLayer, orHitDeferis created (ensureHitDevToolsInitialized). - Add optional
debugLabelonHitLayer,HitDefer,HitScope, andSliverHitScope(also onHitDeferRegistration) for DevTools / Inspector.
1.2.0 #
Breaking deferred-hit API cleanup:
- Replace static
Hit.defer/Hit.beforewith widgetHitDefer. - Replace
paintOnTop/paintUnderbooleans withHitDeferPaint(none,onTop). - Remove under-scope deferred paint (
Hit.before/paintUnder); useHitDeferPaint.onTop(composited) instead. - Replace
HitDeferRegistration.deferPaintOnTop/deferPaintUnderwithdeferPaint. HitLinkno longer extendsChangeNotifier. UsepaintListenable/addPaintListenerfor membership and deferred paint; usegeometryListenable/addGeometryListenerformarkGeometryDirty. Scopes subscribe to paint only, so geometry dirty (e.g. scroll / bounds) does not force a scope repaint.HitLinkmembership is identity-based (identical) for O(1)contains/add.
Migration #
| Before | After |
|---|---|
Hit.defer(child: w) |
HitDefer(child: w) |
Hit.defer(paintOnTop: true, child: w) |
HitDefer(paint: HitDeferPaint.onTop, child: w) |
Hit.before(child: w) |
HitDefer(paint: HitDeferPaint.onTop, child: w) |
target.deferPaintOnTop |
target.deferPaint == HitDeferPaint.onTop |
target.deferPaintUnder |
target.deferPaint == HitDeferPaint.onTop |
link.addListener(fn) |
link.addPaintListener(fn) |
link.removeListener(fn) |
link.removePaintListener(fn) |
HitDeferPaint.none (default) paints in place; only hit testing is deferred.
onTop paints after the scoped subtree via a composited leader/follower so
paint tracks scroll without a full HitScope repaint.
1.1.0 #
- Add
SliverHitScope/SliverHitScopeStatefor deferred hits insideCustomScrollView(and other viewport) sliver trees. - Introduce
HitScopeHandle;HitScope.of/maybeOfnow returnHitScopeHandleand resolve the nearestHitScopeorSliverHitScope(HitScopeState/SliverHitScopeStateboth implement the handle). - Example: Basics + Slivers tabs; settings via
CupertinoMenuAnchoron the navigation bar.
1.0.0 #
Stable release. Public API is the surface exported by package:hit/hit.dart:
HitLayer,HitScope/HitScopeStateHit.defer/Hit.beforeHitLink,HitDeferRegistration
No breaking changes from 0.3.2. Docs and example now cover common HitScope
mistakes (scope too small, clip above scope, missing scope) and scrubbers that
do not fight the page scroll view on small screens.
0.3.2 #
- Fix deferred targets staying on a stale registry when
HitScope.linkchanges at runtime (inherited notify + re-registration). - Make overflowing
HitLayerwithout aHitScope/linkreject hits outside the layout box in release (same contract as the debug assert). - Remove unused per-pass AABB cache; skip no-op
RenderHitScope.linkupdates. - Add
HitLayer.computeDryLayout; lazy-create the scope's internalHitLink. - Harden
Hit.defernull-child hit paths; expand link-swap and overflow tests.
0.3.1 #
- Add package banner and
screenshotsfor pub.dev display. - Point README banner at an absolute GitHub raw URL so it renders on pub.dev.
0.3.0 #
- Narrow the supported public API:
package:hit/hit.dartexports widgets and the registry protocol (Hit,HitLayer,HitScope,HitScopeState,HitLink,HitDeferRegistration). Render objects are no longer exported. HitScope.ofnow throws aFlutterErrorwhen no scope is found (was assert-only).- Document deferred
opaquesemantics: stops further deferred scanning and skips the scoped subtree; document intentional defaultbehaviordifferences (HitLayeropaque vsHit.defer/Hit.beforetranslucent). - Expand tests:
Hit.before, nested scopes, explicit outerHitLink, opaque subtree skip,HitScope.of/maybeOf,ClipRectcull,Transform. - Add GitHub Actions CI (
flutter analyze+flutter test). - Declare supported platforms in
pubspec.yaml.
0.2.0 #
- Fix
Hit.defer(paintOnTop: true)with scroll views: deferred paint uses a composited leader/follower so it tracks transforms without a fullHitScoperepaint. - Fix disposed-layer crash when reusing
paintOnTopfollower layers across frames (LayerHandle). - Expand example app with more demos (
Hit.before, resize, window edge, chip, list, slider) and Cupertino UI.
0.1.0 #
- Initial release:
HitLayer,HitScope,Hit.defer/Hit.before, andHitLink.
