update method

  1. @override
void update(
  1. double dt
)
override

Implementation of Component's update() method. Derived classes are not expected to redefine this.

Implementation

@override
void update(double dt) {
  if (_paused || _finished) {
    return;
  }
  if (!_started && controller.started) {
    _started = true;
    onStart();
  }
  controller.advance(dt);
  if (_started) {
    final progress = controller.progress;
    apply(progress);
    _lastProgress = progress;
  }
  if (!_finished && controller.completed) {
    _finished = true;
    onFinish();
    if (removeOnFinish) {
      removeFromParent();
    }
  }
}