From 675f5ef155d9a5e61a90cc42092847141d3123db Mon Sep 17 00:00:00 2001 From: Samuel Date: Sun, 30 May 2021 14:43:15 +0800 Subject: [PATCH] added disableRotation property --- lib/src/crop.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/crop.dart b/lib/src/crop.dart index f86011e..b11aff5 100644 --- a/lib/src/crop.dart +++ b/lib/src/crop.dart @@ -22,6 +22,7 @@ class Crop extends StatefulWidget { final BoxShape shape; final ValueChanged? onChanged; final Duration animationDuration; + final bool disableRotation; Crop({ Key? key, @@ -38,6 +39,7 @@ class Crop extends StatefulWidget { this.shape: BoxShape.rectangle, this.onChanged, this.animationDuration = const Duration(milliseconds: 200), + this.disableRotation = false, }) : super(key: key); @override @@ -196,7 +198,7 @@ class _CropState extends State with TickerProviderStateMixin { // In the case where lesser than 2 fingers involved in scaling, we ignore // the rotation handling. - if (details.pointerCount > 1) { + if (details.pointerCount > 1 && !widget.disableRotation) { // In the first touch, we reset all the values. if (_previousPointerCount != details.pointerCount) { _previousPointerCount = details.pointerCount;