PainterUtil class

绘制工具

Constructors

PainterUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

paintArc(Canvas canvas, Offset center, double radius, {double startAngle = 0.0, double sweepAngle = 360.0, Color color = Colors.blue, double strokeWidth = 1}) → void
绘制圆弧
center 圆心坐标
radius 半径
startAngle 开始角度
sweepAngle 间隔角度
color 画笔颜色
strokeWidth 画笔宽度
paintFiveStart(Canvas canvas, Offset center, double radius, {Color color = Colors.red, double rotateAngle = 0}) → void
绘制五角星
center 中心点
radius 外接圆半径
color 文本颜色
rotateAngle 旋转角度
paintLine(Canvas canvas, double startX, double endX, {Offset center = const Offset(0, 0), Color color = Colors.red, double rotateAngle = 0, double strokeWidth = 1}) → void
绘制线段
paintString(Canvas canvas, Offset point, String text, {double fontSize = 12, Color color = Colors.black, double rotateAngle = 0}) → void
绘制字符串
point 绘制中点
text 显示文本
fontSize 文本大小
color 文本颜色
rotateAngle 旋转角度