bottomCenterPositionCalculation method

Offset bottomCenterPositionCalculation(
  1. Size buttonSize,
  2. Size popupSize,
  3. Offset offset
)

Calculate the location from (0, 0) of the screen if the menu is located at the bottom 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 bottomCenterPositionCalculation(
    Size buttonSize, Size popupSize, Offset offset) {
  return Offset(offset.dx - (popupSize.width / 2) + (buttonSize.width / 2),
      offset.dy + buttonSize.height);
}