toggleCardWithoutAnimation method

void toggleCardWithoutAnimation()

Flip the card without playing an animation. This cancels any ongoing animation.

Implementation

void toggleCardWithoutAnimation() {
  controller!.stop();

  widget.onFlip?.call();

  if (widget.onFlipDone != null) widget.onFlipDone!(isFront);

  setState(() {
    isFront = !isFront;
    controller!.value = isFront ? 0.0 : 1.0;
  });
}