crop property

Rect get crop

Current crop rectangle of the image (percentage).

left and right are normalized between 0 and 1 (full width). top and bottom are normalized between 0 and 1 (full height).

If the aspectRatio was specified, the rectangle will be adjusted to fit that ratio.

See also:

  • cropSize, which represents the same rectangle in pixels.

Implementation

Rect get crop => value.crop;
set crop (Rect newCrop)

Implementation

set crop(Rect newCrop) {
  if (value.aspectRatio != null) {
    value = value.copyWith(crop: _adjustRatio(newCrop, value.aspectRatio!));
  } else {
    value = value.copyWith(crop: newCrop);
  }
  notifyListeners();
}