TreeAnimationStyle class
Timing/easing for every animation family in the sliver tree stack.
Immutable value type: pass to TreeController(animationStyle: ...)
(or the declarative widgets) and restyle at runtime by assigning a
new instance. Unset fallback families (enterExit, makeRoom,
dropSettle) INHERIT: they track later changes to the family they
fall back to, and copyWith preserves that unset-ness.
- Annotations
Constructors
- TreeAnimationStyle({TreeAnimationSpec expandCollapse = defaultSpec, TreeAnimationSpec? enterExit, TreeAnimationSpec reorderSlide = defaultSpec, TreeAnimationSpec? makeRoom, TreeAnimationSpec? dropSettle})
-
Builds a style from per-family specs. Leaving
enterExit,makeRoomordropSettlenull is NOT the same as passing a copy of the family it falls back to: null keeps it inheriting, so a later restyle of the root family carries through to it.const - TreeAnimationStyle.uniform({required Duration duration, required Curve curve})
-
One spec for all five families: sets the two root families and
leaves the other three inheriting them.
factory
Properties
- dropSettle → TreeAnimationSpec?
-
Drop-settle glide timing as configured, or null when inheriting
reorderSlide. Consumers read effectiveDropSettle.
no setter
- effectiveDropSettle → TreeAnimationSpec
-
dropSettle resolved through its fallback to reorderSlide.
no setter
- effectiveEnterExit → TreeAnimationSpec
-
enterExit resolved through its fallback to expandCollapse.
no setter
- effectiveMakeRoom → TreeAnimationSpec
-
makeRoom resolved through its fallback to reorderSlide.
no setter
- enterExit → TreeAnimationSpec?
-
Node enter/exit (insert/remove) timing as configured, or null when
inheriting expandCollapse. Consumers read effectiveEnterExit.
no setter
- expandCollapse → TreeAnimationSpec
-
Expand/collapse timing: per-operation groups and bulk
expandAll/collapseAll.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- makeRoom → TreeAnimationSpec?
-
Make-room preview timing as configured, or null when inheriting
reorderSlide. Consumers read effectiveMakeRoom.
no setter
- reorderSlide → TreeAnimationSpec
-
FLIP reorder-slide timing:
moveNode,reorderRoots/reorderChildren,animateSlideFromOffsets, drag-commit slides.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{TreeAnimationSpec? expandCollapse, TreeAnimationSpec? enterExit, TreeAnimationSpec? reorderSlide, TreeAnimationSpec? makeRoom, TreeAnimationSpec? dropSettle}) → TreeAnimationStyle - Copies with the given fields replaced. Omitted fields keep their stored value, including a stored "unset" for the fallback families, which therefore keep inheriting. Un-setting a fallback family that was previously set is not expressible; construct a fresh style.
-
debugValidate(
) → bool -
Debug validation at the injection boundary (TreeController's
constructor and
animationStylesetter): every configured duration must be non-negative. A negative duration has no meaning and would STRAND animations, since progress can never reach 1, which blockshasActiveAnimations-gated machinery (eviction deferral, sticky precomputation). Lives here rather than in the const constructor because Dart forbids non-const expressions in const ctor asserts. Returns true so it can sit inside anassert. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
specFor(
TreeAnimationFamily family) → TreeAnimationSpec -
Resolves
familyto its effective spec, applying the inheritance chain. The ONE mapping from a declared family to its timing. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- defaultSpec → const TreeAnimationSpec
- The ONE uniform default spec backing every family: 300ms, linear. A single shared const: there is deliberately no per-family default literal anywhere else in the package.
- disabled → const TreeAnimationStyle
- Every family off: a total animation disable, and the configuration tests use when they need mutations to settle synchronously.