scale method

Widget scale({
  1. required bool visible,
  2. double begin = 0.0,
  3. double end = 1.0,
  4. Duration duration = const Duration(milliseconds: 300),
  5. Curve curve = Curves.easeInOut,
  6. bool autoRun = true,
})

Scales the widget in and out

Implementation

Widget scale({
  required bool visible,
  double begin = 0.0,
  double end = 1.0,
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeInOut,
  bool autoRun = true, // Automatically run animation on build
}) {
  return AnimatedVisibility(
    visible: visible,
    autoRun: autoRun,
    builder: (context, animationVisible) => AnimatedScale(
      scale: animationVisible ? end : begin,
      duration: duration,
      curve: curve,
      child: this,
    ),
    child: this,
  );
}