ReorderPreviewEngine class

Paint-only held-offset engine. See the library doc for how it composes with the FLIP engine.

Every entry is either animating toward its target or HELD at it, which _PreviewEntry.done records. The ticker runs only while at least one entry is still animating, so a fully held preview costs nothing per frame even though paint keeps reading its offsets.

Constructors

ReorderPreviewEngine({required TickerProvider vsync, required VoidCallback onTick})

Properties

hasActive → bool
Whether any row currently carries a preview offset, animating or held. Composed into TreeController.hasActiveSlides, which is what gates the render layer's slide-aware paths.
no setter
hashCode → int
The hash code for this object.
no setterinherited
liftedNid → int
The nid a held make-room preview has LIFTED (the dragged row; its visible subtree rides with it), or -1 when no preview is installed (M11). Independent of _entries: an own-slot hover legitimately holds no offsets while the row is still lifted and hidden, so this survives releaseAll and the tick's arrived-at-zero cleanup. It is cleared by setLifted with -1 (the controller's preview clear), snapClearAll, clearAll, and a clearForNid of the lifted nid itself.
no setter
maxAbsDelta → double
TERMINAL bound on every offset this engine will produce from now on, composed into the layout overreach bound so preview-shifted rows stay built.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAll() → void
Resets all state and disposes the ticker. Next use recreates it.
clearForNid(int nid) → void
Defensive slot reset mirroring the other per-nid stores: a nid freed or re-adopted mid-preview must not keep a stale offset.
deltaForNid(int nid) → double
Preview delta for nid, or 0.0 when not previewing.
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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
releaseAll({required Duration duration, required Curve curve}) → void
Releases every entry toward zero (animated). Entries are removed as they arrive; hasActive flips false when the last one settles.
setLifted(int nid) → void
Records the lifted nid; -1 clears it.
setTargetsForNids(Map<int, double> targets, {required Duration duration, required Curve curve, required bool snap}) → void
Re-targets the preview to exactly targets, mapping nid to held offset.
snapClearAll() → void
Drops every entry instantly and notifies once. Used by the commit path (the FLIP baseline has already captured the shifted painted positions; the mutation's layout takes over from here) and by teardown paths where animating a release is meaningless.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited