ButtonAnimationStyle.shake constructor

ButtonAnimationStyle.shake({
  1. Duration duration = const Duration(milliseconds: 400),
  2. Curve curve = Curves.easeInOut,
  3. bool enableHapticFeedback = true,
  4. double shakeOffset = 8.0,
  5. int shakeCount = 3,
})

Horizontal shake (programmatic trigger) Best for error states

Implementation

factory ButtonAnimationStyle.shake({
  Duration duration = const Duration(milliseconds: 400),
  Curve curve = Curves.easeInOut,
  bool enableHapticFeedback = true,
  double shakeOffset = 8.0,
  int shakeCount = 3,
}) {
  return ButtonAnimationStyle._(
    type: ButtonAnimationType.shake,
    duration: duration,
    curve: curve,
    enableHapticFeedback: enableHapticFeedback,
    shakeOffset: shakeOffset,
    shakeCount: shakeCount,
  );
}