ChartContextMenuHelper class

Helper for displaying a chart context menu as an application overlay.

Usage (from inside a chart's tap callback):

ChartContextMenuHelper.show(
  context,
  point: point,
  segment: null,
  position: globalTapPosition,
  onViewDetails: () { /* ... */ },
);

Only one menu is shown at a time; calling show again replaces the current menu. Calling hide is idempotent.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Properties

isVisible bool
Whether a menu is currently on screen.
no setter

Static Methods

hide() → void
Dismiss the current menu if any. Safe to call when no menu is visible.
show(BuildContext context, {required ChartDataPoint? point, required PieData? segment, required Offset position, int? datasetIndex, int? elementIndex, String? datasetLabel, ChartTheme? theme, Color? backgroundColor, bool useGlassmorphism = false, bool useNeumorphism = false, bool backgroundBlur = false, VoidCallback? onViewDetails, VoidCallback? onExport, VoidCallback? onShare}) → void
Display a context menu anchored near position (in global coordinates).