buildTransitions<T> method

Widget buildTransitions <T>(PageRoute<T> route, BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child)

Delegates to the builder for the current ThemeData.platform or FadeUpwardsPageTransitionsBuilder.

MaterialPageRoute.buildTransitions delegates to this method.

Implementation

Widget buildTransitions<T>(
  PageRoute<T> route,
  BuildContext context,
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  TargetPlatform platform = Theme.of(context).platform;

  if (CupertinoPageRoute.isPopGestureInProgress(route))
    platform = TargetPlatform.iOS;

  final PageTransitionsBuilder matchingBuilder =
    builders[platform] ?? const FadeUpwardsPageTransitionsBuilder();
  return matchingBuilder.buildTransitions<T>(route, context, animation, secondaryAnimation, child);
}