createAnimationController method Null safety

AnimationController createAnimationController()

Called to create the animation controller that will drive the transitions to this route from the previous one, and back to the previous route from this one.

The returned controller will be disposed by AnimationController.dispose if the willDisposeAnimationController is true.

Implementation

AnimationController createAnimationController() {
  assert(!_transitionCompleter.isCompleted, 'Cannot reuse a $runtimeType after disposing it.');
  final Duration duration = transitionDuration;
  final Duration reverseDuration = reverseTransitionDuration;
  assert(duration != null && duration >= Duration.zero);
  return AnimationController(
    duration: duration,
    reverseDuration: reverseDuration,
    debugLabel: debugLabel,
    vsync: navigator!,
  );
}