shrink static method

Widget shrink(
  1. Animation<double> animation,
  2. Animation<double> secondaryAnimation,
  3. Widget child
)

Scale animation, from out to in (ScaleTransition)

Implementation

static Widget shrink(
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  return FadeTransition(
    opacity: animation,
    child: ScaleTransition(
      scale: Tween<double>(
        begin: 1.2,
        end: 1,
      ).animate(
        CurvedAnimation(
          parent: animation,
          curve: const Interval(
            0.50,
            1,
          ),
        ),
      ),
      child: child,
    ),
  );
}