hit 1.2.4
hit: ^1.2.4 copied to clipboard
Decouple Flutter layout size from hit-test size, and deliver taps outside parent bounds.
1.2.4 #
- Shrink the published DevTools extension assets (~43 MB → ~5.5 MB on disk,
~1 MB compressed archive): tree-shake Material icons and omit local
CanvasKit (loaded from the Flutter CDN at runtime). See
tool/build_devtools.sh. - Add Probe mode to the hit DevTools extension: tap the connected app to
list every hit area under that point (
Hit.probed) with diagnostic notes for misses. Mutually exclusive with Select; reuses cancelled pointer intercept. Service extensions:ext.hit.getProbeMode/ext.hit.setProbeMode(debugHitProbeEnabled). - Fix Select / highlight IDE jump for
HitScope,SliverHitScope, andHitDefer: inspect the public widget call site instead of the private render-object wrapper (_HitScopeRenderObjectWidget, etc.). - Include
globalBounds/ target hit bounds forSliverHitScopein DevTools snapshots so Probe / Select can detect sliver scopes (previously omitted because they are notRenderBox). - Deduplicate Probe hits: a deferred
HitLayer/HitDeferis listed once (enriched with scope id/label) instead of bothlayeranddeferredTarget. - Probe marks the Flutter hit-test winner (deepest hit-package node on
the real path), sorts path hits leaf→root to mirror nesting / opaque
deferred order, and labels AABB-only overlaps as
overlap only. HitScope.hitTestnow adds itself to the hit-test path (likeSliverHitScope) so Probe can show delivering scopes asin path.
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.
