LineDrawingToolConfig class

Line drawing tool config.

Placed with two anchors exactly like SegmentDrawingToolConfig (same fields, same hit-test/drag/toolbar/hover-or-selected measurement label, via LineInteractableDrawing extending SegmentInteractableDrawing) — but unlike a Segment, the rendered/clickable line extends past both anchors to the chart's edges, the way Horizontal/Vertical extend across their one dimension. LineInteractableDrawing shows no Y-axis value label of its own; that's TrendDrawingToolConfig's addition, described below.

overlayStyle is this codebase's own addition — legacy (pre-V2) overlay styling for getLabelPainter. Note TrendDrawingToolConfig is a separate, unrelated config class (not a subclass of this one) with its own labelStyle field for TrendLineInteractableDrawing's Y-axis value labels and price/percent/bar-count readout — see that class's doc comment for why it can't share this class's hierarchy.

Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

LineDrawingToolConfig({String? configId, DrawingData? drawingData, List<EdgePoint> edgePoints = const <EdgePoint>[], LineStyle lineStyle = const LineStyle(color: CoreDesignTokens.coreColorSolidBlue700), TextStyle labelStyle = const TextStyle(color: CoreDesignTokens.coreColorSolidBlue700, fontSize: 12, fontWeight: FontWeight.normal, fontFamily: 'Inter'), OverlayStyle? overlayStyle, DrawingPatterns pattern = DrawingPatterns.solid, int number = 0})
Initializes
const
LineDrawingToolConfig.fromJson(Map<String, dynamic> json)
Initializes from JSON.
factory

Properties

configId String?
Drawing tool config id.
finalinherited
drawingData DrawingData?
Drawing tool data.
finalinherited
edgePoints List<EdgePoint>
Drawing tool edge points.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isOverlay bool
Whether the add-on is an overlay on the main chart or displays on a separate chart. Default is set to true.
finalinherited
labelStyle TextStyle
The style of the label showing on y-axis. Only consumed by TrendLineInteractableDrawing (via TrendDrawingToolConfig) — see the class doc comment above.
final
lineStyle LineStyle
Drawing tool line style
finalinherited
number int
The number of this add-on.
finalinherited
overlayStyle OverlayStyle?
Drawing tool overlay style
final
pattern → DrawingPatterns
Drawing tool line pattern: 'solid', 'dotted', 'dashed'
finalinherited
props List<Object>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

copyWith({String? configId, DrawingData? drawingData, LineStyle? lineStyle, LineStyle? fillStyle, TextStyle? labelStyle, OverlayStyle? overlayStyle, DrawingPatterns? pattern, List<EdgePoint>? edgePoints, bool? enableLabel, int? number}) LineDrawingToolConfig
Creates a copy of this object.
override
getInteractableDrawing(DrawingContext drawingContext, GetDrawingState getDrawingState) → LineInteractableDrawing
Returns back the InteractableDrawing instance of this drawing tool.
override
getItem(UpdateDrawingTool updateDrawingTool, VoidCallback deleteDrawingTool) → DrawingToolItem
Creates drawing tool.
override
getLabelPainter({required Point startPoint, required Point endPoint}) → LineDrawingToolLabelPainter?
Create label painter for the drawing tool.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialization to JSON. Serves as value in key-value storage.
override
toString() String
A string representation of this object.
inherited

Operators

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

Constants

name → const String
Drawing tool name