AcePainter class abstract

Inheritance
Mixed-in types
Implementers

Constructors

AcePainter({required List<AceEntity> values, required double paddingTop, required Color averageLineColor, required double average, double? lastClose, required double scrollX, required double scale, required double pointSpace, required double pointWidth, Offset? pressOffset, required TextStyle crossUpperTextStyle, required TextStyle crossLowerTextStyle, required Color crossTextBgColor, required Color crossTextBorderColor, required Color crossLineColor, required double crossLineWidth, required List<Color> maDayColors, required double maStrokeWidth, required Color gridLineColor, required int gridVerticalGrids, required int gridHorizontalGrids, required double gridLineWidth, required TextStyle gridUpperStyle, required TextStyle gridTextStyle, required TextStyle gridlowerStyle, required TextStyle horizontalTextStyle, required String transformTime(int time), void onDrawCross(int index, MainAxisAlignment alignment, Offset pressOffset)?})

Properties

average double
final
averageLineColor Color
final
canvasHeight double
getter/setter pairinherited
canvasWidth double
getter/setter pairinherited
contentHeight double
曲线图的绘制高度
getter/setter pair
crossLineColor Color
final
crossLineWidth double
final
crossLowerTextStyle TextStyle
final
crossTextBgColor Color
final
crossTextBorderColor Color
final
crossUpperTextStyle TextStyle
交叉线样式
final
endIndex int
getter/setter pairinherited
gridHorizontalGrids int
网格水平分成几格
final
gridLineColor Color
网格线颜色
final
gridLineWidth double
final
gridlowerStyle TextStyle
网格数值比lastClose小时展示的颜色
final
gridTextStyle TextStyle
final
gridUpperStyle TextStyle
网格数值比lastClose大时展示的颜色
final
gridVerticalGrids int
网格垂直分成几格
final
hashCode int
The hash code for this object.
no setterinherited
horizontalTextStyle TextStyle
底部水平文字样式
final
lastClose double?
final
maDayColors List<Color>
ma线颜色,对应多条ma线
final
maStrokeWidth double
ma线粗细
final
maxValue double
最大数据
getter/setter pairinherited
minValue double
最小数据
getter/setter pairinherited
onDrawCross → void Function(int index, MainAxisAlignment alignment, Offset pressOffset)?
绘制交叉线回调
final
paddingLeft double
finalinherited
paddingRight double
finalinherited
paddingTop double
finalinherited
pointSpace double
点之间的间距
finalinherited
pointWidth double
finalinherited
pressOffset Offset?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
放大倍数
finalinherited
scrollX double
滚动位置
finalinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setterinherited
startIndex int
getter/setter pairinherited
transformTime String Function(int time)
final
values List<AceEntity>
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint.
inherited
bisectionTransformXToIndex(double x, int start, int end) int
二分查找法
inherited
createText({required String text, required TextStyle style}) TextPainter
创建一个文本TextPainter
inherited
drawCross(Canvas canvas) → void
绘制交叉线
drawCrossLine({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double scrollX, required double scale, required double dx, required double dy, required Color color, required double strokeWidth}) → void
交叉线
inherited
drawCrossText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double scrollX, required double scale, required double dx, required double dy, required double pressX, required String yText, required String xText, required TextStyle style, required Color bgColor, required Color borderColor}) → void
绘制交叉点文字
inherited
drawGrid({required Canvas canvas, required double canvasWidth, required double canvasHeight, required int verticalGrids, required int horizontalGrids, required Color lineColor, required double strokeWidth, required double paddingTop}) → void
inherited
drawGridText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required int verticalGrids, required int horizontalGrids, required double maxValue, required double minValue, required double paddingTop, required TextStyle lowerStyle, required TextStyle upperStyle, required TextStyle gridTextStyle, double? lastClose}) → void
绘制网格文字
inherited
drawGridVerticalText({required Canvas canvas, required double canvasWidth, required double canvasHeight, required double value, required double dy, required TextStyle style, double? lastClose}) → void
绘制垂直文字
inherited
drawLine({required Canvas canvas, required double startX, required double startY, required double endX, required double endY, required double strokeWidth, required Color color}) → void
inherited
drawLineCart({required Canvas canvas, required int maxLength, required double strokeWidth, required Color lineColor, Shader? chartShader}) → void
绘制曲线图
drawVerticalDottedLine({required Canvas canvas, required double canvasWidth, required double y, required Color color, double scale = 1}) → void
绘制横虚线
inherited
dxToTransformX(double dx) double
X轴坐标值转translate后的坐标值
inherited
getCrossDx(int index) double
getCrossIndex() int
getRealItemWidth() double
getValues() List<double>
获取转换后的数据列表
inherited
hitTest(Offset position) bool?
Called whenever a hit test is being performed on an object that is using this custom paint delegate.
inherited
indexToX(int index) double
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCompute(Size size) → void
获取画布宽度和高度 计算当前屏内相对转换后的X轴位置 根据X轴位置,计算屏内起始和结束展示数据的索引 计算最大值和最小值
override
onDraw(Canvas canvas) → void
override
onDrawCart(Canvas canvas) → void
paint(Canvas canvas, Size size) → void
Called whenever the object needs to paint. The given Canvas has its coordinate space configured such that the origin is at the top left of the box. The area of the box is the size of the size argument.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies when it is time to repaint.
inherited
shouldRebuildSemantics(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
shouldRepaint(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
toString() String
A string representation of this object.
inherited
transformValues() List<double>
inherited
transformXToIndex(double translateX) int
将translate后的坐标值转换成数据索引
inherited
valueToY(double value) double
inherited

Operators

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