animationStyle property

TreeAnimationStyle get animationStyle

Animation timing/easing for every family: expand/collapse, enter/exit, reorder slides, make-room preview, drop settle.

Mutable at runtime. When TreeAnimationStyle.expandCollapse's duration changes, the new value is written onto every in-flight AnimationController (operation groups and the bulk group), but a running simulation is not re-timed: the controller reads duration at the next forward()/reverse(), so in-flight groups finish at their old rate and the new duration applies from the next start. Curves apply to newly started groups only. The per-node standalone ticker re-reads each state's DECLARED family spec (TreeAnimationStyle.specFor of AnimationState.family) on every tick, so standalone animations adjust immediately; zeroing a family makes THAT family's in-flight standalone states complete (finalize) on the next tick while the other family's keep running.

Implementation

TreeAnimationStyle get animationStyle {
  return _animationStyle;
}
set animationStyle (TreeAnimationStyle value)

Implementation

set animationStyle(TreeAnimationStyle value) {
  assert(value.debugValidate());
  if (value == _animationStyle) {
    return;
  }
  final oldOpDuration = _animationStyle.expandCollapse.duration;
  final oldSlideDuration = _animationStyle.reorderSlide.duration;
  _animationStyle = value;
  final newOpDuration = value.expandCollapse.duration;
  if (newOpDuration != oldOpDuration) {
    _activeBulkGroup?.controller.duration = newOpDuration;
    for (final entry in _opGroupEntries) {
      entry.value.controller.duration = newOpDuration;
    }
  }
  // Disabled-mode split: a zero family CREATES no motion (install-time
  // refusal), while DISABLING, this transition, STOPS motion. Zeroing
  // the reorderSlide family purges in-flight slides here, explicitly;
  // no other family transition purges (a live drop-settle glide already
  // survives a live dropSettle zeroing, and standalone/op-group
  // families carry their own live-read semantics).
  if (oldSlideDuration != Duration.zero &&
      value.reorderSlide.duration == Duration.zero) {
    _slide.purgeActive();
    // Rows painted mid-delta must repaint at their snapped positions.
    _notifyAnimationListeners();
  }
}