topCenterPositionCalculation method
Calculate the location from (0, 0) of the screen if the menu is located at the top center of the dropdown button. Given the location of the button (offset), the size of the popup menu, and the size of the dropdown menu button, calculate location of the menu.
Implementation
Offset topCenterPositionCalculation(
Size buttonSize, Size popupSize, Offset offset) {
return Offset(
offset.dx + (buttonSize.width / 2) - (popupSize.width / 2),
offset.dy - popupSize.height,
);
}