defaultTapHandler static method

void defaultTapHandler(
  1. BuildContext context,
  2. VoidCallback? onTap
)

Default tap handler for PullDownMenuItem.

The behaviour is to pop the menu and than call the onTap.

Implementation

static void defaultTapHandler(BuildContext context, VoidCallback? onTap) {
  // If menu was opened from [PullDownButton] or [showPullDownMenu] then pop
  // route.
  if (ModalRoute.of(context) is PullDownMenuRoute) {
    Navigator.pop(context, onTap);
  } else {
    noPopTapHandler(context, onTap);
  }
}