materialTabTransition top-level property

RouteTransitionsBuilder materialTabTransition
final

Implementation

final RouteTransitionsBuilder materialTabTransition = (
  BuildContext context,
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  Widget appear = FadeTransition(
    opacity: animation.drive(
      Tween<double>(
        begin: 0.0,
        end: 1.0,
      ).chain(CurveTween(curve: Curves.fastOutSlowIn)),
    ),
    child: ScaleTransition(
      scale: animation.drive(
        Tween<double>(
          begin: 0.8,
          end: 1.0,
        ).chain(CurveTween(curve: Curves.fastOutSlowIn)),
      ),
      child: child,
    ), // child is the value returned by pageBuilder
  );

  Widget disappear = FadeTransition(
    opacity: secondaryAnimation.drive(
      Tween<double>(
        begin: 1.0,
        end: 0.0,
      ).chain(CurveTween(curve: Curves.fastOutSlowIn)),
    ),
    child: ScaleTransition(
      scale: secondaryAnimation.drive(
        Tween<double>(
          begin: 1.0,
          end: 1.4,
        ).chain(CurveTween(curve: Curves.fastOutSlowIn)),
      ),
      child: appear,
    ), // child is the value returned by pageBuilder
  );
  return disappear;
};