CropRotateEditorConfigs class
Configuration options for a crop and rotate editor.
CropRotateEditorConfigs
allows you to define various settings for a
crop and rotate editor. You can enable or disable specific features like
cropping, rotating, and maintaining aspect ratio. Additionally, you can
specify an initial aspect ratio for cropping.
Example usage:
CropRotateEditorConfigs(
enabled: true,
enabledRotate: true,
enabledAspectRatio: true,
initAspectRatio: CropAspectRatios.custom,
);
Constructors
-
CropRotateEditorConfigs({double desktopCornerDragArea = 7, double mobileCornerDragArea = kMinInteractiveDimension, bool enabled = true, bool canRotate = true, bool canFlip = true, bool enableDoubleTap = true, bool transformLayers = true, bool canChangeAspectRatio = true, bool canReset = true, bool reverseMouseScroll = false, bool reverseDragDirection = false, bool roundCropper = false, double? initAspectRatio, Curve rotateAnimationCurve = Curves.decelerate, Curve scaleAnimationCurve = Curves.decelerate, Curve cropDragAnimationCurve = Curves.decelerate, Curve fadeInOutsideCropAreaAnimationCurve = Curves.decelerate, RotateDirection rotateDirection = RotateDirection.left, Duration opacityOutsideCropAreaDuration = const Duration(milliseconds: 100), Duration animationDuration = const Duration(milliseconds: 250), Duration fadeInOutsideCropAreaAnimationDuration = const Duration(milliseconds: 350), Duration cropDragAnimationDuration = const Duration(milliseconds: 400), double maxScale = 7, double mouseScaleFactor = 0.1, double doubleTapScaleFactor = 2, List<
AspectRatioItem> aspectRatios = const [AspectRatioItem(text: 'Free', value: -1), AspectRatioItem(text: 'Original', value: 0.0), AspectRatioItem(text: '1*1', value: 1.0 / 1.0), AspectRatioItem(text: '4*3', value: 4.0 / 3.0), AspectRatioItem(text: '3*4', value: 3.0 / 4.0), AspectRatioItem(text: '16*9', value: 16.0 / 9.0), AspectRatioItem(text: '9*16', value: 9.0 / 16.0)]}) -
Creates an instance of CropRotateEditorConfigs with optional settings.
const
Properties
- animationDuration → Duration
-
The duration for the animation controller that handles rotation and scale animations.
final
-
aspectRatios
→ List<
AspectRatioItem> -
The allowed aspect ratios for cropping.
final
- canChangeAspectRatio → bool
-
Indicating whether the aspect ratio of the image can be changed.
final
- canFlip → bool
-
Indicating whether the image can be flipped.
final
- canReset → bool
-
Indicating whether the editor can be reset.
final
- canRotate → bool
-
Indicating whether the image can be rotated.
final
- cropDragAnimationCurve → Curve
-
The animation curve used for crop animations.
final
- cropDragAnimationDuration → Duration
-
The duration of drag-crop animations.
final
- desktopCornerDragArea → double
-
Defines the size of the draggable area on corners of the crop rectangle for desktop devices.
final
- doubleTapScaleFactor → double
-
The scaling factor applied when double-tapping.
final
- enabled → bool
-
Indicates whether the editor is enabled.
final
- enableDoubleTap → bool
-
Enables double-tap zoom functionality when set to true.
final
- fadeInOutsideCropAreaAnimationCurve → Curve
-
The animation curve used for the fade in animation from content outside the crop area.
final
- fadeInOutsideCropAreaAnimationDuration → Duration
-
Fade in animation from content outside the crop area.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initAspectRatio → double?
-
The initial aspect ratio for cropping.
final
- maxScale → double
-
The maximum scale allowed for the view.
final
- mobileCornerDragArea → double
-
Defines the size of the draggable area on corners of the crop rectangle for mobile devices.
final
- mouseScaleFactor → double
-
The scaling factor applied to mouse scrolling.
final
- opacityOutsideCropAreaDuration → Duration
-
The duration of the outside crop area opacity.
final
- reverseDragDirection → bool
-
Determines if the drag direction should be reversed.
final
- reverseMouseScroll → bool
-
Determines if the mouse scroll direction should be reversed.
final
- rotateAnimationCurve → Curve
-
The curve used for the rotation animation.
final
- rotateDirection → RotateDirection
-
The direction in which the image will be rotated.
final
- roundCropper → bool
-
The cropper is round and not rectangular, which is optimal for cutting profile images.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleAnimationCurve → Curve
-
The curve used for the scale animation, which is triggered when the image needs to resize due to rotation.
final
- transformLayers → bool
-
Layers will also be transformed like the crop-rotate image.
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