ScatterTouchData constructor

ScatterTouchData({
  1. bool? enabled,
  2. BaseTouchCallback<ScatterTouchResponse>? touchCallback,
  3. MouseCursorResolver<ScatterTouchResponse>? mouseCursorResolver,
  4. Duration? longPressDuration,
  5. ScatterTouchTooltipData? touchTooltipData,
  6. double? touchSpotThreshold,
  7. bool? handleBuiltInTouches,
})

You can disable or enable the touch system using enabled flag,

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 ScatterTouchResponse which contains information about the elements that has touched.

Using mouseCursorResolver you can change the mouse cursor based on the provided FlTouchEvent and ScatterTouchResponse

if handleBuiltInTouches is true, ScatterChart shows a tooltip popup on top of the spots if touch occurs (or you can show it manually using, ScatterChartData.showingTooltipIndicators) You can customize this tooltip using touchTooltipData,

If you need to have a distance threshold for handling touches, use touchSpotThreshold.

Implementation

ScatterTouchData({
  bool? enabled,
  BaseTouchCallback<ScatterTouchResponse>? touchCallback,
  MouseCursorResolver<ScatterTouchResponse>? mouseCursorResolver,
  Duration? longPressDuration,
  ScatterTouchTooltipData? touchTooltipData,
  double? touchSpotThreshold,
  bool? handleBuiltInTouches,
})  : touchTooltipData = touchTooltipData ?? ScatterTouchTooltipData(),
      touchSpotThreshold = touchSpotThreshold ?? 0,
      handleBuiltInTouches = handleBuiltInTouches ?? true,
      super(
        enabled ?? true,
        touchCallback,
        mouseCursorResolver,
        longPressDuration,
      );