CrossTransition.scale constructor

CrossTransition.scale({
  1. Duration? duration,
  2. Duration? reverseDuration,
  3. double begin = 1.25,
  4. double end = 0.75,
  5. Curve curveIn = Curves.easeIn,
  6. Curve curveOut = Curves.easeOut,
  7. Curve fadeIn = Curves.easeInQuad,
  8. Curve fadeOut = Curves.easeOut,
})

Implementation

factory CrossTransition.scale({
  Duration? duration,
  Duration? reverseDuration,
  double begin = 1.25,
  double end = 0.75,
  Curve curveIn = Curves.easeIn,
  Curve curveOut = Curves.easeOut,
  Curve fadeIn = Curves.easeInQuad,
  Curve fadeOut = Curves.easeOut,
}) =>
    CrossTransition(
      duration: duration ?? _kCrossDuration,
      reverseDuration: reverseDuration,
      transitionIn: (child, anim) => ScaleTransition(
        scale: Tween<double>(begin: begin, end: 1.0).animate(CurvedAnimation(
          parent: anim,
          curve: curveIn,
        )),
        child: FadeTransition(
          opacity: _progress.animate(CurvedAnimation(
            parent: anim,
            curve: fadeIn,
          )),
          child: child,
        ),
      ),
      transitionOut: (child, anim) => ScaleTransition(
        scale: Tween<double>(begin: end, end: 1.0).animate(CurvedAnimation(
          parent: anim,
          curve: curveIn,
        )),
        child: FadeTransition(
          opacity: _progress.animate(CurvedAnimation(
            parent: anim,
            curve: fadeOut,
          )),
          child: child,
        ),
      ),
    );