SlideAnimationEngine<TKey> class
Paint-only FLIP slide engine. See the library doc for the timing model.
Two protocols here are load-bearing and easy to break. The SETTLE
protocol in _onSlideTick notifies with deltas at exactly 0 BEFORE
removing completed entries, then notifies once more after cleanup so
listeners can observe the active-to-idle transition. And COMPOSITION
retargets an entry in place, which is why completion cleanup checks
SlideAnimation.installStamp as well as identity: a listener may have
composed onto the very entry that just completed.
Constructors
-
SlideAnimationEngine({required TickerProvider vsync, required NodeIdRegistry<
TKey> nids, required VoidCallback onTick})
Properties
- hasActive → bool
-
Whether any slide is currently installed, animating or settled but
not yet cleaned up. Composed into
TreeController.hasActiveSlides.no setter - hasActiveX → bool
-
Whether any active slide entry is animating horizontally
(startDeltaX != 0). Lets render-layer hot paths skip per-row
X-delta reads when no X-axis work is in flight.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxAbsDelta → double
-
Maximum |currentDelta| across every active slide entry, or 0.0 when
no slides are active.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
animateFromOffsets(
Map< TKey, ({double x, double y})> priorOffsets, Map<TKey, ({double x, double y})> currentOffsets, {required Duration duration, required Curve curve, required bool structuralAnimationsDisabled, double maxSlideDistance = double.infinity}) → void -
Installs FLIP slides for every node whose offset changed between
priorOffsetsandcurrentOffsets. See TreeController.animateSlideFromOffsets for the full contract. -
cancelForKey(
TKey key) → void -
Cancels the slide for
key, if any. Tolerant of unregistered keys. Used by_cancelAnimationStateForSubtreeduring reparenting. -
clearAll(
) → void -
Resets every slide-related field back to its initial state and
disposes the ticker. Called from
TreeController._clear(and indirectly fromdispose). The next animateFromOffsets call recreates the ticker via the existing_ticker ??= ...pattern. NOT safe mid-lifecycle, since it drops_slideByNidcapacity; use purgeActive for that. -
clearForNid(
int nid) → void -
Defensive slot reset for the nid adopt and release paths.
Bounds-checked because those can run before resizeForCapacity has
grown this engine's array to cover
nid. -
debugAssertConsistent(
) → void -
Verifies
_activeSlideNidsmirrors_slideByNidexactly. Throws StateError on inconsistency. Wrapped inassertat call sites so release builds skip it. -
deltaForKey(
TKey key) → double -
Slide delta for
key, or 0.0 if not currently sliding (or not registered). -
deltaForNid(
int nid) → double -
Slide delta for the live
nid, or 0.0 if not currently sliding. Caller must guaranteenidis within range. -
deltaXForKey(
TKey key) → double -
X-axis slide delta for
key, or 0.0 if not currently sliding (or not registered). -
deltaXForNid(
int nid) → double -
X-axis (cross-axis indent) slide delta for the live
nid, or 0.0 if not currently sliding. Caller must guaranteenidis within range. -
dispose(
) → void - Terminal teardown. Identical to clearAll, which already disposes the ticker, and kept as its own entry point so every engine tears down through the same name.
-
markPreserveProgress(
TKey key) → void -
Sets SlideAnimation.preserveProgressOnRebatch = true on the slide
entry for
key. Tolerant of unregistered keys and inactive slides (no-op). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
purgeActive(
) → void - Capacity-preserving purge of every active slide: entries cleared and the ticker STOPPED, not disposed, so the next install restarts it.
-
resizeForCapacity(
int nidCapacity) → void -
Grows the per-nid slide array to match
nidCapacity. Called byTreeController._onStoreCapacityGrewin lockstep with every other per-nid array. New slots default to null (not sliding). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited