buildTransitions<T> method Null safety

Widget buildTransitions<T>(
  1. PageRoute<T> route,
  2. BuildContext context,
  3. Animation<double> animation,
  4. Animation<double> secondaryAnimation,
  5. Widget child
)

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

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 (CupertinoRouteTransitionMixin.isPopGestureInProgress(route)) {
    platform = TargetPlatform.iOS;
  }

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