BubbleTapCallback typedef
BubbleTapCallback =
ChartPointCallback
Callback for bubble chart tap interactions.
Invoked when a user taps on a bubble in a bubble chart.
Supported Charts:
- Bubble charts (
BubbleChartWidget)
Parameters:
point- The tapped bubble data point (never null)datasetIndex- The index of the dataset containing this bubble (never null)pointIndex- The index of the bubble within its dataset (never null)position- The global tap position (useful for showing context menus)
Usage Notes:
- This callback is nullable - if null, tap interactions are disabled
- Haptic feedback is automatically provided on mobile platforms
- The tap detection uses ChartInteractionConstants.tapRadius * 3 for hit detection (larger radius due to bubble size variability)
Example
onBubbleTap: (point, datasetIndex, pointIndex, position) {
print('Tapped bubble: ${point.y} with size ${(point as BubbleDataPoint).size}');
showContextMenu(position);
}
See also:
onBubbleHoverfor hover events (desktop/web only)ChartPointCallbackfor other point-based chartsChartInteractionConstantsfor interaction configuration
Implementation
typedef BubbleTapCallback = ChartPointCallback;