dismiss method

void dismiss({
  1. VoidCallback? onDismissed,
})

Dismiss the dropdown menu. if onDismissed is provided, it would be called after the menu is dismissed.

Implementation

void dismiss({VoidCallback? onDismissed}) {
  if (!isOpen) return;
  _menuOverlay?.remove();
  _menuOverlay = null;
  onDismissed?.call();
}