dispose method

void dispose()

Implementation

void dispose() {
  // Stop the ticker if it's active
  if (_ticker.isActive) {
    _ticker.stop();
  }

  // Dispose all animations
  for (Animation animation in [..._animations]) {
    animation.dispose();
  }
  _animations.clear();

  // Dispose the ticker to release resources
  _ticker.dispose();
}