CropConfig class

Cropper tool configuration. Attached to a DisplayConfig via DisplayConfig.crop. When non-null in the active mode's DisplayConfig, the Cropper widget renders crop UI and applies these constraints when the user manipulates the crop rect.

Constructors

CropConfig({double? minAspectRatio, double? maxAspectRatio, Size? shortest, Size? longest, double? smallest, double? largest, Rect initialRect(Rect baseRect)?, BorderRadius borderRadius(Rect cropRect)?, double overdragMax = 3.0})
const

Properties

borderRadius BorderRadius Function(Rect cropRect)?
Computes the visual border radius from the current crop rect. Lets the radius scale with the rect's dimensions — e.g., (r) => BorderRadius.circular(r.shortestSide / 2) for a circular preview, (r) => BorderRadius.circular(r.shortestSide / 8) for a soft-rounded square. Null = rectangular preview.
final
hashCode int
The hash code for this object.
no setterinherited
initialRect Rect Function(Rect baseRect)?
Computes the initial crop rect given the base rect. Null = default to the base rect itself.
final
largest double?
Maximum area (e.g. width × height cap). Null = no area limit.
final
longest Size?
Maximum dimensions. Null = no maximum.
final
maxAspectRatio double?
final
minAspectRatio double?
Allowed aspect-ratio range (width / height) for the crop rect. Both null = free aspect. Equal min/max = locked aspect.
final
overdragMax double
Caps the per-frame image shift applied when the crop rect is being dragged into the edge of the image (see ScaleExt.imageRectOnDragCropRect). Higher values let the image catch up to the finger more aggressively when the crop is pinned against an edge; lower values keep the image steadier. Default 3.0, matching imagineai's original tuning.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortest Size?
Minimum dimensions. Null = no minimum.
final
smallest double?
Minimum area (e.g. width × height floor). Null = no area floor.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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