getMaxHeight method

  1. @override
num? getMaxHeight(
  1. num positionY,
  2. num viewportHeight
)
override

The max height.

Returns null if max height is not specified.

Implementation

@override
num? getMaxHeight(num positionY, num viewportHeight) {
  var maxHeight =
      delegatePopupSizeProvider.getMaxHeight(positionY, viewportHeight);
  if (_popupPosition == PopupPosition.BELOW) {
    // Prevent popup content from going off the bottom of the visible
    // viewport.
    return max(_MIN_HEIGHT_PX,
        min(viewportHeight - positionY - _EDGE_SPACE_PX, maxHeight!));
  } else {
    return maxHeight;
  }
}