animateIdle method

void animateIdle({
  1. PinIdleAnimation animation = PinIdleAnimation.wave,
  2. bool vibration = false,
  3. int repeatCount = 1,
  4. VoidCallback? onComplete,
  5. VoidCallback? onInterrupt,
  6. double animationSpeed = 1.0,
})

Method for calling animation with input type for PinIndicator associated with this controller. Call this method when user is inactive for a long time to let them know that action is required and show that app is still alive.

Implementation

void animateIdle({
  /// {@macro pin_ui.PinXAnimation}
  PinIdleAnimation animation = PinIdleAnimation.wave,

  /// {@macro pin_ui.vibration}
  bool vibration = false,

  /// {@macro pin_ui.repeatCount}
  int repeatCount = 1,

  /// {@macro pin_ui.onComplete}
  VoidCallback? onComplete,

  /// {@macro pin_ui.onInterrupt}
  VoidCallback? onInterrupt,

  /// {@macro pin_ui.animationSpeed}
  double animationSpeed = 1.0,
}) {
  assert(repeatCount > 0 && repeatCount < 10);
  for (int i = 0; i < repeatCount; i++) {
    _prepareAndStart(
      animation,
      onComplete: i == repeatCount - 1 ? onComplete : null,
      onInterrupt: onInterrupt,
      animationSpeed: animationSpeed,
      vibration: vibration,
    );
  }
}