heartbeat static method

Animation<double> heartbeat(
  1. AnimationController controller
)

Creates a heartbeat animation (two quick pulses).

Implementation

static Animation<double> heartbeat(AnimationController controller) {
  return TweenSequence<double>([
    TweenSequenceItem(
      tween: Tween(begin: 1.0, end: 1.15)
          .chain(CurveTween(curve: Curves.easeOut)),
      weight: 15,
    ),
    TweenSequenceItem(
      tween: Tween(begin: 1.15, end: 1.0)
          .chain(CurveTween(curve: Curves.easeIn)),
      weight: 15,
    ),
    TweenSequenceItem(
      tween: Tween(begin: 1.0, end: 1.1)
          .chain(CurveTween(curve: Curves.easeOut)),
      weight: 15,
    ),
    TweenSequenceItem(
      tween:
          Tween(begin: 1.1, end: 1.0).chain(CurveTween(curve: Curves.easeIn)),
      weight: 15,
    ),
    TweenSequenceItem(
      tween: ConstantTween(1.0),
      weight: 40,
    ),
  ]).animate(controller);
}