CropperImage class

图像裁剪,适用于头像裁剪和输出固定尺寸的图片裁剪

Inheritance

Constructors

CropperImage(ImageProvider<Object> image, {Key? key, CropperController? controller, bool limitations = true, bool isArc = false, double backBoxSize = 10.0, Color backBoxColor0 = Colors.grey, Color backBoxColor1 = Colors.white, Color maskColor = _defualtMaskColor, Color lineColor = Colors.white, double lineWidth = 3, double outWidth = 256.0, double outHeight = 256.0, double maskPadding = 20.0, double round = 8.0})

Properties

backBoxColor0 Color
backBoxColor0 背景方格颜色0 默认值:Colors.grey
final
backBoxColor1 Color
backBoxColor1  背景方格颜色1 默认值:Colors.white
final
backBoxSize double
backBoxSize 背景方格大小 默认值:10
final
controller CropperController?
final
hashCode int
The hash code for this object.
no setterinherited
image ImageProvider<Object>
image 输入图片源
final
isArc bool
isArc 是否是圆形 默认值:false
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
limitations bool
limitations 限制位置和尺寸 默认值:false 当为true 是不能旋转图像
final
lineColor Color
lineColor 预览框颜色 默认值:Colors.white
final
lineWidth double
lineWidth 预览框线宽 默认值:3
final
maskColor Color
maskColor 蒙板颜色 默认值:#00000080
final
maskPadding double
maskPadding 蒙板内边距 默认值:20
final
outHeight double
outHeight 输出图片高度 默认值:256
final
outWidth double
outWidth 输出图片宽度 默认值:256
final
round double
round 预览框圆角 默认值:8
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() CropperImageElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
override
createRenderObject(BuildContext context) CropperImageRender
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
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.
override
didUnmountRenderObject(covariant RenderObject renderObject) → void
A render object previously associated with this widget has been removed from the tree. The given RenderObject will be of the same type as returned by this object's createRenderObject.
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
updateRenderObject(BuildContext context, covariant CropperImageRender renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

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