TrendLineAddingPreviewDesktop class

Desktop-specific implementation of trend line adding preview with advanced animations.

This class provides enhanced desktop functionality including:

  • Animated alignment guide transitions (fade-out → delay → fade-in)
  • Start point pulse animation with glow effects
  • Real-time hover feedback with alignment guides
  • Smooth 60fps animation updates

The animation sequence triggers when the first point is clicked:

  1. 250ms alignment guide fade-out
  2. 100ms delay
  3. 250ms alignment guide fade-in + 500ms start point pulse (simultaneous)
Inheritance

Constructors

TrendLineAddingPreviewDesktop({required InteractiveLayerBehaviour interactiveLayerBehaviour, required TrendLineInteractableDrawing interactableDrawing, required dynamic onAddingStateChange(AddingStateInfo)})
Initializes the desktop trend line adding preview

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
The id of the drawing which should be unique for each drawing in InteractiveLayer.
no setteroverride
interactableDrawing TrendLineInteractableDrawing
The reference to the InteractableDrawing instance of the drawing tool that is going to be added.
finalinherited
interactiveLayerBehaviour InteractiveLayerBehaviour
The current interactive layer behaviour which is active and defines how this preview should behave.
finalinherited
onAddingStateChange → dynamic Function(AddingStateInfo)
A callback to the current step of the tool adding process.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createPoint(TapUpDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY) → void
Handles the creation of trend line points during the drawing process.
inherited
drawPointGuidesAndLabels(Canvas canvas, Size size, Offset pointOffset, EpochToX epochToX, QuoteToY quoteToY, EpochFromX epochFromX, QuoteFromY quoteFromY, ChartConfig chartConfig, ChartTheme chartTheme, {bool showGuides = true, bool showLabels = true}) → void
Draws alignment guides and labels for a point during interactions.
inherited
drawPreviewLine(Canvas canvas, Offset startPosition, Offset endPosition, DrawingPaintStyle paintStyle, LineStyle lineStyle, {bool isDashed = false}) → void
Draws a preview line between two points with optional dashed styling.
inherited
drawStyledFocusedCircle(DrawingPaintStyle paintStyle, LineStyle lineStyle, Canvas canvas, Offset offset, double animationPercent) → void
Draws a focused circle effect around a point during interactions.
inherited
drawStyledPoint(EdgePoint point, EpochToX epochToX, QuoteToY quoteToY, Canvas canvas, DrawingPaintStyle paintStyle, LineStyle lineStyle, {double radius = pointRadius}) → void
Draws a trend line point with consistent styling across platforms.
inherited
drawStyledPointOffset(Offset offset, EpochToX epochToX, QuoteToY quoteToY, Canvas canvas, DrawingPaintStyle paintStyle, LineStyle lineStyle, {double radius = pointRadius}) → void
Draws a trend line point at a specific screen offset with consistent styling.
inherited
edgePointToOffset(EdgePoint point, EpochToX epochToX, QuoteToY quoteToY) Offset
Converts a chart coordinate point to screen coordinates.
inherited
getStyles() → (DrawingPaintStyle, LineStyle)
Retrieves the current drawing paint style and line style configuration.
inherited
hitTest(Offset offset, EpochToX epochToX, QuoteToY quoteToY) bool
Returns true if the drawing tool is hit by the given offset.
override
isInViewPort(EpochRange epochRange, QuoteRange quoteRange) bool
Determines if the drawing preview is within the current chart viewport.
inherited
isValidPoint(EdgePoint? point) bool
Validates whether a point is valid and can be used for drawing.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetToEdgePoint(Offset offset, EpochFromX epochFromX, QuoteFromY quoteFromY) → EdgePoint
Converts screen coordinates to a chart coordinate point.
inherited
onCreateTap(TapUpDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Handles tap events during the drawing creation process.
override
onDragEnd(DragEndDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Handles the end of a drag gesture during drawing creation.
inherited
onDragStart(DragStartDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Handles the start of a drag gesture during drawing creation.
inherited
onDragUpdate(DragUpdateDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Handles updates during a drag gesture for drawing creation.
inherited
onHover(PointerHoverEvent event, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Handles hover events during drawing creation (desktop platforms).
override
onLongPressEnd(EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when a long press ends on the drawing tool.
inherited
onLongPressStart(Offset localPosition, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when a long press starts on the drawing tool.
inherited
paint(Canvas canvas, Size size, EpochToX epochToX, QuoteToY quoteToY, AnimationInfo animationInfo, ChartConfig chartConfig, ChartTheme chartTheme, GetDrawingState getDrawingState) → void
Paints the drawing tool on the chart.
override
paintOverYAxis(Canvas canvas, Size size, EpochToX epochToX, QuoteToY quoteToY, EpochFromX? epochFromX, QuoteFromY? quoteFromY, AnimationInfo animationInfo, ChartConfig chartConfig, ChartTheme chartTheme, GetDrawingState getDrawingState) → void
Paints the drawing tool chart but over the Y-axis.
override
shouldRepaint(Set<DrawingToolState> drawingState, DrawingV2 oldDrawing) bool
Determines if the drawing preview needs to be repainted.
inherited
toString() String
A string representation of this object.
inherited

Operators

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