handleHiding method

void handleHiding()

Method that will be called when AbstractTransitionComponent first enters the hiding state.

Implementation

void handleHiding() {
  if (_transitionNotGuaranteed) {
    // No transition will occur, so kick off the state change manually.
    //
    // Do this in a microtask since this state change causes invariant exceptions
    // when OverlayTrigger API methods are called at the same time.
    //
    // TODO: possibly remove microtask once using react-dart 1.0.0
    scheduleMicrotask(() {
      setState(newState()
        ..transitionPhase = TransitionPhase.HIDDEN
      );
    });

    _cancelTransitionEventListener();
    _cancelTransitionEndTimer();
  } else {
    onNextTransitionEnd(() {
      if (!_isUnmounted && state.transitionPhase == TransitionPhase.HIDING) {
        setState(newState()
          ..transitionPhase = TransitionPhase.HIDDEN
        );
      }
    });
  }
}