Crop class
Widget for the entry point of crop_your_image.
- Inheritance
Constructors
-
Crop({Key? key, required Uint8List image, required ValueChanged<
Uint8List> onCropped, double? aspectRatio, double? initialSize, CroppingRectBuilder? initialRectBuilder, ImageBasedRect? initialArea, bool withCircleUi = false, CropController? controller, ValueChanged<ViewportBasedRect> ? onMoved, ValueChanged<CropStatus> ? onStatusChanged, Color? maskColor, Color baseColor = Colors.white, double radius = 0, CornerDotBuilder? cornerDotBuilder, Clip clipBehavior = Clip.hardEdge, bool fixCropRect = false, Widget progressIndicator = const SizedBox.shrink(), bool interactive = false, WillUpdateScale? willUpdateScale, FormatDetector? formatDetector = defaultFormatDetector, ImageCropper imageCropper = defaultImageCropper, ImageParser? imageParser, double scrollZoomSensitivity = 0.05})
Properties
- aspectRatio → double?
-
fixed aspect ratio of cropping rect.
null, by default, means no fixed aspect ratio.
final
- baseColor → Color
-
Color of the base color of the cropping editor.
final
- clipBehavior → Clip
-
Clip configuration for crop editor, especially corner dots.
Clip.hardEdge by default.
final
- controller → CropController?
-
conroller for control crop actions
final
- cornerDotBuilder → CornerDotBuilder?
-
Builder function for corner dot widgets.
CornerDotBuilder passes
size
which indicates a desired size of each dots and EdgeAlignment which indicates the position of each dot. If you want default dot widget with different color, DotControl is available.final - fixCropRect → bool
-
If fixCropRect and interactive are both
true
, cropping rect is fixed and can't be moved.false
by default.final - formatDetector → FormatDetector?
-
(Advanced) Injected logic for detecting image format.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- image → Uint8List
-
original image data
final
- imageCropper → ImageCropper
-
(Advanced) Injected logic for cropping image.
final
- imageParser → ImageParser
-
(Advanced) Injected logic for parsing image detail.
final
- initialArea → ImageBasedRect?
-
Initial ImageBasedRect of cropping rect, called "area" in this package.
final
- initialRectBuilder → CroppingRectBuilder?
-
Builder for initial ViewportBasedRect of cropping rect.
Builder is called when calculating initial cropping rect
with passing ViewportBasedRect of viewport and image.
final
- initialSize → double?
-
initial size of cropping rect.
Set double value less than 1.0.
if initialSize is 1.0 (or null),
cropping area would expand as much as possible.
final
- interactive → bool
-
If
true
, the cropping editor is changed to interactive mode and users can zoom and pan the image.false
by default.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maskColor → Color?
-
Color of the mask widget which is placed over the cropping editor.
final
-
onCropped
→ ValueChanged<
Uint8List> -
callback when cropping completed
final
-
onMoved
→ ValueChanged<
ViewportBasedRect> ? -
Callback called when cropping rect changes for any reasons.
final
-
onStatusChanged
→ ValueChanged<
CropStatus> ? -
Callback called when status of Crop widget is changed.
final
- progressIndicator → Widget
-
Widget for showing preparing for image is in progress.
SizedBox.shrink() is used by default.
final
- radius → double
-
Corner radius of cropping rect
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollZoomSensitivity → double
-
(for Web) Sets the mouse-wheel zoom sensitivity for web applications.
final
- willUpdateScale → WillUpdateScale?
-
Function called before scaling image.
Note that this function is called multiple times during user tries to scale image.
If this function returns
false
, scaling is canceled.final - withCircleUi → bool
-
flag if cropping image with circle shape.
As oval shape is not supported, aspectRatio is fixed to 1 if withCircleUi is true.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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}) → 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