handleTap method Null safety

  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() {
  widget.onTap?.call();

  Navigator.pop<T>(context, widget.value);
}