withScale method

Widget withScale({
  1. double begin = 0.8,
  2. double end = 1.0,
  3. Duration duration = const Duration(milliseconds: 300),
  4. Curve curve = Curves.easeOutBack,
})

Wrap with scale animation on appear.

Implementation

Widget withScale({
  double begin = 0.8,
  double end = 1.0,
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeOutBack,
}) {
  return TweenAnimationBuilder<double>(
    tween: Tween(begin: begin, end: end),
    duration: duration,
    curve: curve,
    builder: (context, scale, child) => Transform.scale(
      scale: scale,
      child: child,
    ),
    child: this,
  );
}