DrawingController class

绘制控制器

Inheritance

Constructors

DrawingController({DrawConfig? config, PaintContent? content})

Properties

couldDraw bool
能否进行绘制
no setter
currentContent PaintContent?
当前绘制内容
getter/setter pair
currentIndex int
获取当前步骤索引
no setter
drawConfig SafeValueNotifier<DrawConfig>
控制器
getter/setter pair
getColor Color
获取当前颜色
no setter
getHistory List<PaintContent>
获取绘制图层/历史
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
painter RePaintNotifier?
表层画布刷新控制
getter/setter pair
painterKey GlobalKey<State<StatefulWidget>>
画板数据Key
getter/setter pair
realPainter RePaintNotifier?
底层画布刷新控制
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startPoint Offset?
开始绘制点
no setter

Methods

addContent(PaintContent content) → void
添加一条绘制数据
addContents(List<PaintContent> contents) → void
添加多条数据
addFingerCount(Offset offset) → void
手指落下
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
cancelDraw() → void
取消绘制
canRedo() bool
Check if redo is available. Returns true if possible.
canUndo() bool
Check if undo is available. Returns true if possible.
clear() → void
清理画布
dispose() → void
销毁控制器
override
drawing(Offset nowPaint) → void
正在绘制
endDraw() → void
结束绘制
getImageData() Future<ByteData?>
获取图片数据
getJsonList() List<Map<String, dynamic>>
获取画板内容Json
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
redo() → void
重做
reduceFingerCount(Offset offset) → void
手指抬起
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setBoardSize(Size? size) → void
设置画板大小
setPaintContent(PaintContent content) → void
设置绘制内容
setStyle({BlendMode? blendMode, Color? color, ColorFilter? colorFilter, FilterQuality? filterQuality, ImageFilter? imageFilter, bool? invertColors, bool? isAntiAlias, MaskFilter? maskFilter, Shader? shader, StrokeCap? strokeCap, StrokeJoin? strokeJoin, double? strokeMiterLimit, double? strokeWidth, PaintingStyle? style}) → void
设置绘制样式
startDraw(Offset startPoint) → void
开始绘制
toString() String
A string representation of this object.
inherited
turn() → void
  • 旋转画布
  • 设置角度
  • undo() → void
    撤销

    Operators

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