InteractableDrawing<T extends DrawingToolConfig> class abstract

The class that will be generated by the drawing tool config instance when they are created or the saved ones that are loaded from storage. The information from this class (its subclasses) will be used to draw the tool on the chart. It will keep the latest state of the drawing tool as the user interacts with the tools in the runtime. During the time that user interacts with a tool. by some debounce mechanism This class will update the config which is supposed to be saved in the storage.

Implemented types
Implementers

Constructors

InteractableDrawing({required T drawingConfig, required DrawingContext drawingContext, required GetDrawingState getDrawingState})
Initializes InteractableDrawing.

Properties

config ↔ T
The drawing tool config.
getter/setter pair
drawingContext → DrawingContext
A callback to get the updated state of any drawing tool when calling it.
final
getDrawingState → GetDrawingState
A callback to get the current state of a drawing.
final
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
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state Set<DrawingToolState>
Returns the current state of this drawing tool.
no setter

Methods

buildDrawingToolBarMenu(UpdateDrawingTool onUpdate) Widget
Builds the toolbar menu for the drawing tool.
getAddingPreviewForDesktopBehaviour(InteractiveLayerDesktopBehaviour layerBehaviour, dynamic onAddingStateChange(AddingStateInfo)) DrawingAddingPreview<InteractableDrawing<DrawingToolConfig>>
Returns back the InteractableDrawing which is used for showing the preview of the tool when we're on InteractiveLayerDesktopBehaviour.
getAddingPreviewForMobileBehaviour(InteractiveLayerMobileBehaviour layerBehaviour, dynamic onAddingStateChange(AddingStateInfo)) DrawingAddingPreview<InteractableDrawing<DrawingToolConfig>>
Returns back the InteractableDrawing which is used for showing the preview of the tool when we're on InteractiveLayerMobileBehaviour.
getToolBarMenu({required UpdateDrawingTool onUpdate}) Widget
Returns the widget for the toolbar menu of the drawing tool. config is the current configuration of the drawing tool.
getUpdatedConfig() → T
Returns the updated config.
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
Whether this drawing is in epoch range.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDragEnd(DragEndDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when the drawing tool dragging is ended.
override
onDragStart(DragStartDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when the drawing tool dragging is started.
override
onDragUpdate(DragUpdateDetails details, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when the drawing tool is dragged and updates the drawing position properties based on the dragging details.
override
onHover(PointerHoverEvent event, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when the user's pointer is hovering over the drawing tool.
override
onLongPressEnd(EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when a long press ends on the drawing tool.
override
onLongPressStart(Offset localPosition, EpochFromX epochFromX, QuoteFromY quoteFromY, EpochToX epochToX, QuoteToY quoteToY) → void
Called when a long press starts on the drawing tool.
override
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, covariant InteractableDrawing<T> oldDrawing) bool
Returns true if the drawing tool should repaint.
override
toString() String
A string representation of this object.
inherited

Operators

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