open method

void open(
  1. {Offset? position}
)

Opens the menu that this menu controller is associated with.

If position is given, then the menu will open at the position given, in the coordinate space of the MenuAnchor this controller is attached to.

If given, the position will override the MenuAnchor.alignmentOffset given to the MenuAnchor.

If the menu's anchor point (either a MenuBar or a MenuAnchor) is scrolled by an ancestor, or the view changes size, then any open menu will automatically close.

Implementation

void open({Offset? position}) {
  assert(_anchor != null);
  _anchor!._open(position: position);
}