handlePressed method

void handlePressed(
  1. BuildContext context,
  2. VoidCallback action
)

Convenience method to auto-close the context menu when an action is triggered which you almost always want to do in a context menu.

Implementation

void handlePressed(BuildContext context, VoidCallback action) {
  action.call();
  overlay.hide();
}