debugValidate method
Debug validation at the injection boundary (TreeController's
constructor and animationStyle setter): every configured
duration must be non-negative. A negative duration has no meaning
and would STRAND animations, since progress can never reach 1, which
blocks hasActiveAnimations-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 an assert.
Implementation
bool debugValidate() {
assert(
!expandCollapse.duration.isNegative &&
!(_enterExit?.duration.isNegative ?? false) &&
!reorderSlide.duration.isNegative &&
!(_makeRoom?.duration.isNegative ?? false) &&
!(_dropSettle?.duration.isNegative ?? false),
"TreeAnimationStyle durations must be non-negative — a negative "
"duration strands its animations (progress can never complete).",
);
return true;
}