DrawingTool class abstract
Constructors
- DrawingTool.new({required String id, required DrawingToolType type, required DateTime createTime, Color color = const Color(0xFFFFD700), double strokeWidth = 2.0, bool isVisible = true, DrawingToolState state = DrawingToolState.none})
Properties
- color ↔ Color
-
getter/setter pair
- createTime → DateTime
-
final
- displayName → String
-
获取工具类型的显示名称
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
获取工具类型的图标
no setter
- id → String
-
final
- isComplete → bool
-
no setter
- isVisible ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ DrawingToolState
-
getter/setter pair
- strokeWidth ↔ double
-
getter/setter pair
- type → DrawingToolType
-
final
Methods
-
draw(
Canvas canvas, Size size, double scaleX, double scrollX, double getX(double), double getY(double)) → void -
drawSelectionIndicator(
Canvas canvas, {double highlightOpacity = 0.3}) → void - 绘制选中状态的视觉反馈
-
getBounds(
) → Rect -
getFillPaint(
{double? opacity}) → Paint - 获取填充Paint对象
-
getPaint(
{double? opacity}) → Paint - 获取绘制时的Paint对象
-
hitTest(
Offset point) → bool -
move(
Offset delta) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
distanceBetweenPoints(
Offset p1, Offset p2) → double - 计算两点之间的距离
-
distanceFromPointToLine(
Offset point, Offset lineStart, Offset lineEnd) → double - 计算点到线段的距离
-
fromJson(
Map< String, dynamic> json) → DrawingTool?