shake method

void shake()

Programmatically trigger the shake animation (useful for error states)

Implementation

void shake() {
  if (widget.animationStyle.type == ButtonAnimationType.shake ||
      widget.animationStyle.type != ButtonAnimationType.none) {
    _triggerHapticFeedback();
    _shakeController.forward(from: 0.0).then((_) {
      _shakeController.reset();
    });
  }
}