onNextTransitionEnd method

  1. @mustCallSuper
void onNextTransitionEnd(
  1. dynamic complete()
)

Listens for the next transitionend event and invokes a callback after the event is dispatched.

Implementation

@mustCallSuper
void onNextTransitionEnd(Function() complete) {
  var transitionCount = isOrWillBeHidden ? transitionOutCount : transitionInCount;

  _cancelTransitionEventListener();
  _cancelTransitionEndTimer();

  _transitionEndTimer = Timer(transitionTimeout, () {
    assert(ValidationUtil.warn(
        'The number of transitions expected to complete have not completed. Something is most likely wrong.',
        this
    ));

    _cancelTransitionEventListener();

    complete();
  });

  _endTransitionSubscription = getTransitionDomNode()?.onTransitionEnd.skip(transitionCount - 1).take(1).listen((_) {
    _cancelTransitionEndTimer();

    complete();
  });
}