pulse method

Future<void> pulse({
  1. int count = 1,
  2. double pulseScale = 1.1,
})

Pulse animation - scale up and down

Implementation

Future<void> pulse({int count = 1, double pulseScale = 1.1}) async {
  if (!mounted || _controller.isAnimating || !_isInitialized) return;
  if (!_shouldAnimate(context)) return;

  for (int i = 0; i < count; i++) {
    await _controller.forward().orCancel;
    await _controller.reverse().orCancel;
    if (!mounted || _isDisposed) break;
  }
}