rotate method

void rotate()

Rotates the image clockwise.

Implementation

void rotate() {
  if (!cropRotateEditorConfigs.canRotate) return;

  _blockInteraction = true;
  var piHelper =
      cropRotateEditorConfigs.rotateDirection == RotateDirection.left
          ? -pi
          : pi;

  rotationCount++;
  rotateAnimation = Tween<double>(
          begin: rotateAnimation.value, end: rotationCount * piHelper / 2)
      .animate(
    CurvedAnimation(
      parent: rotateCtrl,
      curve: cropRotateEditorConfigs.rotateAnimationCurve,
    ),
  );
  rotateCtrl
    ..reset()
    ..forward();
  calcFitToScreen();

  cropRotateEditorCallbacks?.handleRotateStart(rotateAnimation.value);
}