handleTap method

  1. @protected
void handleTap()

The handler for when the user selects the menu item.

Used by the InkWell inserted by the build method.

By default, uses Navigator.pop to return the PopupMenuItem.value from the menu route.

Implementation

@protected
void handleTap() {
  // Need to pop the navigator first in case onTap may push new route onto navigator.
  Navigator.pop<T>(context, widget.value);

  widget.onTap?.call();
}