CropController class final

The CropController manages the state and behaviour of image cropping. It holds data such as image size, crop mode, image rectangle, and crop rectangle, as well as a reference to the image data.

Constructors

CropController()

Properties

bytes Uint8List?
Stores the image data to be cropped.
getter/setter pair
cropRect Rect?
Gets the crop Rect stored in the ValueNotifier.
getter/setter pair
cropRectNotifier ValueNotifier<Rect?>
Stores the selected crop area within the view.
final
cropSize Size
Calculates the crop size based on the relative positions of the cropRect, imageRect and the original imageSize.
no setter
hashCode int
The hash code for this object.
no setterinherited
imageRect Rect?
Gets the image Rect stored in the ValueNotifier.
getter/setter pair
imageRectNotifier ValueNotifier<Rect?>
Stores the image's position and size within the view.
final
imageSize Size?
Gets the image Size stored in the ValueNotifier.
getter/setter pair
imageSizeNotifier ValueNotifier<Size?>
Stores the size of the image to be cropped.
final
mode CropMode
Gets the CropMode stored in the ValueNotifier.
getter/setter pair
modeNotifier ValueNotifier<CropMode>
Stores the CropMode of the image to be cropped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

crop({ImageFormat format = ImageFormat.jpg}) Future<Uint8List>
Performs the actual cropping by calling the corresponding NativeImageCropper method. You can additionally set the ImageFormat for compression, defaults to ImageFormat.jpg.
dispose() → void
Releases the resources held by the ValueNotifier.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited