handlePressed method
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();
}