Cropper class
Image-coupled cropper tool. Designed to live in Stage's overlay slot (typically via DisplayConfig.overlay) so its handle detectors render above Stage's own recognizer in the hit-test order.
Reads StageData.crop for the live crop rect (owned by Stage, seeded from CropConfig.initialRect when a crop mode activates) and renders:
- Dim overlay outside the crop rect (shaped by CropConfig.borderRadius).
- Rule-of-thirds grid inside (always rectangular).
- Corner / side resize handles.
Gesture model:
- 1-finger drag on a handle — resizes the crop rect via RectExt.moveCorner / RectExt.moveSide, honoring CropConfig constraints.
- 1-finger drag inside the crop rect — handled by Stage's recognizer: pans the crop rect, with the image coupling at edges via ScaleExt.imageRectOnDragCropRect (cap configurable via CropConfig.overdragMax).
- Pinch / drag outside the crop rect — falls through to Stage's normal scale/drag gestures on the image.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Cropper
Constructors
- Cropper({Key? key, Color dimColor = const Color(0x88000000), Color handleColor = const Color(0xFFFFFFFF), Color gridColor = const Color(0xFFFFFFFF), double gridLineWidth = 0.5, Color? gridBorderColor, double gridBorderWidth = 1, int gridDivisions = 3, double handleThickness = 4, double minHandleDimension = 24})
-
const
Properties
- dimColor → Color
-
final
- gridBorderColor → Color?
-
Color of the outer border. Falls back to gridColor when null.
final
- gridBorderWidth → double
-
Thickness of the outer border (around the crop rect).
final
- gridColor → Color
-
Color of the interior grid lines (and the border by default).
final
- gridDivisions → int
-
Number of grid divisions per axis.
3= rule of thirds (2 interior lines on each axis). Must be ≥ 1.1means no interior lines.final - gridLineWidth → double
-
Thickness of the interior grid lines.
final
- handleColor → Color
-
final
- handleThickness → double
-
Thickness of the visible corner/side handle marks.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minHandleDimension → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Cropper> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited