getIsMenuModalOpened method

bool getIsMenuModalOpened()

Check is menu modally opened

Implementation

bool getIsMenuModalOpened() {
  double menuRight = actualMenuRight;
  bool isMenuOpening = false;

  if (widget.menuLocation == MenuLocation.left) {
    isMenuOpening =
        (widget.menuCloseMode == MenuCloseMode.basic && menuRight > 0) ||
            (widget.menuCloseMode == MenuCloseMode.narrow &&
                menuRight > widget.menuNarrowWidth);
  } else {
    double menuX = getMenuX();
    isMenuOpening = (widget.menuCloseMode == MenuCloseMode.basic &&
            menuX < _availableSize.width) ||
        (widget.menuCloseMode == MenuCloseMode.narrow &&
            menuX < _availableSize.width - widget.menuNarrowWidth);
  }

  return (_isMenuOpen || isMenuOpening) &&
      (widget.bodyBehavior == BodyBehavior.move ||
          widget.menuOpenMode == MenuOpenMode.floating);
}