recede method

  1. @override
double recede(
  1. double dt
)
override

Similar to advance(), but makes the effect controller move back in time.

If the supplied amount of time dt would push the effect past its starting point, then the effect stops at the start and the "leftover" portion of dt is returned.

Implementation

@override
double recede(double dt) {
  if (_timer == delay) {
    _timer -= _child.recede(dt);
  } else {
    _timer -= dt;
  }
  if (_timer < 0) {
    final leftoverTime = -_timer;
    _timer = 0;
    return leftoverTime;
  }
  return 0;
}