PopupMenuPositionBuilder typedef
A builder that creates a RelativeRect to position a popup menu. Both BuildContext and BoxConstraints are from the PopupRoute that displays this menu.
The returned RelativeRect determines the position of the popup menu relative to the bounds of the Navigator's overlay. The menu dimensions are not yet known when this callback is invoked, as they depend on the items and other properties of the menu.
The coordinate system used by the RelativeRect has its origin at the top left of the Navigator's overlay. Positive y coordinates are down (below the origin), and positive x coordinates are to the right of the origin.
See also:
- RelativeRect.fromLTRB, which creates a RelativeRect from left, top, right, and bottom coordinates.
- RelativeRect.fromRect, which creates a RelativeRect from two Rects, one representing the size of the popup menu and one representing the size of the overlay.
Implementation
typedef PopupMenuPositionBuilder =
RelativeRect Function(BuildContext context, BoxConstraints constraints);