Open yuqing374 opened 3 weeks ago
@yuqing374 adding initial builder worked for me:
initialRectBuilder: (viewportRect, imageRect) {
final double halfWidth = imageRect.width / 2;
final double halfHeight = imageRect.height / 2;
return Rect.fromLTWH(
imageRect.left + (imageRect.width - halfWidth) / 2,
imageRect.top + (imageRect.height - halfHeight) / 2,
halfWidth,
halfHeight);
},
the solution from @VitKalini worked for me too
flutter: Instance of 'InvalidRectError' flutter:
0 ImageImageCropper.call (package:crop_your_image/src/logic/cropper/image_image_cropper.dart:35:7)
1 _cropFunc (package:crop_your_image/src/widget/crop.dart:765:18)
2 compute. (package:flutter/src/foundation/_isolates_io.dart:19:20)
3 _RemoteRunner._run (dart:isolate:1090:47)
4 _RemoteRunner._remoteExecute (dart:isolate:1084:12)
5 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:300:17)
6 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
version 1.1.0