Eraser class

橡皮擦绘制内容

使用BlendMode.clear混合模式实现擦除效果 擦除路径会叠加在底层内容上,产生透明擦除效果

Eraser Drawing Content

Uses BlendMode.clear blend mode to achieve erasing effect Eraser path is overlaid on the base content to produce transparent erasing effect

Inheritance

Constructors

Eraser()
Eraser.data({required DrawPath drawPath, required Paint paint})
Eraser.fromJson(Map<String, dynamic> data)
factory

Properties

contentType String
内容类型标识(用于JSON序列化)
no setteroverride
drawPath DrawPath
擦除路径
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
paint Paint
画笔配置
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copy() Eraser
复制实例,避免对象引用传递
override
draw(Canvas canvas, Size size, bool deeper) → void
绘制核心方法 canvas 画布对象 size 画布尺寸 deeper 当前是否为底层绘制(true为历史记录层,false为实时绘制层)
override
drawing(Offset nowPoint) → void
绘制过程中调用(手指移动时)
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startDraw(Offset startPoint) → void
开始绘制(手指按下时)
override
toContentJson() Map<String, dynamic>
转换为JSON内容(子类实现)
override
toJson() Map<String, dynamic>
转换为JSON对象
inherited
toString() String
A string representation of this object.
inherited

Operators

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