LineTouchData class

Holds data to handle touch events, and touch responses in the LineChart.

There is a touch flow, explained here in a simple way, each chart's renderer captures the touch events, and passes the pointerEvent to the painter, and gets touched spot, and wraps it into a concrete LineTouchResponse.

Inheritance

Constructors

LineTouchData({bool enabled = true, BaseTouchCallback<LineTouchResponse>? touchCallback, MouseCursorResolver<LineTouchResponse>? mouseCursorResolver, Duration? longPressDuration, LineTouchTooltipData touchTooltipData = const LineTouchTooltipData(), GetTouchedSpotIndicator getTouchedSpotIndicator = defaultTouchedIndicators, double touchSpotThreshold = 10, CalculateTouchDistance distanceCalculator = _xDistance, bool handleBuiltInTouches = true, GetTouchLineY getTouchLineStart = defaultGetTouchLineStart, GetTouchLineY getTouchLineEnd = defaultGetTouchLineEnd})
You can disable or enable the touch system using enabled flag,
const

Properties

distanceCalculator CalculateTouchDistance
Distance function used when finding closest points to touch point
final
enabled bool
You can disable or enable the touch system using enabled flag,
finalinherited
getTouchedSpotIndicator GetTouchedSpotIndicator
Configs of how touch indicator looks like.
final
getTouchLineEnd GetTouchLineY
The end point on y axis of the touch line. By default, line ends at the touched point. If line end is overlap with the dot, it will be automatically adjusted to the edge of the dot.
final
getTouchLineStart GetTouchLineY
The starting point on y axis of the touch line. By default, line starts on the bottom of the chart.
final
handleBuiltInTouches bool
Determines to handle default built-in touch responses, LineTouchResponse shows a tooltip popup above the touched spot.
final
hashCode int
The hash code for this object.
no setterinherited
longPressDuration Duration?
This property that allows to customize the duration of the longPress gesture. default to 500 milliseconds refer to kLongPressTimeout.
finalinherited
mouseCursorResolver MouseCursorResolver<LineTouchResponse>?
Using mouseCursorResolver you can change the mouse cursor based on the provided FlTouchEvent and BaseTouchResponse
finalinherited
props List<Object?>
Used for equality check, see EquatableMixin.
no setteroverride
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
touchCallback BaseTouchCallback<LineTouchResponse>?
touchCallback notifies you about the happened touch/pointer events. It gives you a FlTouchEvent which is the happened event such as FlPointerHoverEvent, FlTapUpEvent, ... It also gives you a BaseTouchResponse which is the chart specific type and contains information about the elements that has touched.
finalinherited
touchSpotThreshold double
Distance threshold to handle the touch event.
final
touchTooltipData LineTouchTooltipData
Configs of how touch tooltip popup.
final

Methods

copyWith({bool? enabled, BaseTouchCallback<LineTouchResponse>? touchCallback, MouseCursorResolver<LineTouchResponse>? mouseCursorResolver, Duration? longPressDuration, LineTouchTooltipData? touchTooltipData, GetTouchedSpotIndicator? getTouchedSpotIndicator, double? touchSpotThreshold, CalculateTouchDistance? distanceCalculator, GetTouchLineY? getTouchLineStart, GetTouchLineY? getTouchLineEnd, bool? handleBuiltInTouches}) LineTouchData
Copies current LineTouchData to a new LineTouchData, and replaces provided values.
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