trackRoute method
Registers a modal route that is being shown. Only the reverse and dismissed transitions are observed.
Implementation
void trackRoute(ModalRoute<dynamic> route) {
final animation = route.animation;
if (animation == null) return;
void listener(AnimationStatus status) {
if (status == AnimationStatus.reverse) {
_isClosing = true;
_closingStartedAt = DateTime.now();
} else if (status == AnimationStatus.dismissed) {
animation.removeStatusListener(listener);
_isClosing = false;
_closingStartedAt = null;
}
}
animation.addStatusListener(listener);
}