getBodyX method

double getBodyX()

Get body current offset based on menu and submenu offset and width

Implementation

double getBodyX() {
  if (widget.menuLocation == MenuLocation.left) {
    if (widget.subMenuOpenMode == SubMenuOpenMode.basic &&
        widget.menuOpenMode == MenuOpenMode.basic &&
        widget.submenu != null) {
      return actualSubMenuRight;
    } else if (widget.menuOpenMode == MenuOpenMode.basic) {
      return actualMenuRight;
    } else if (widget.menuCloseMode == MenuCloseMode.narrow) {
      return widget.menuNarrowWidth;
    } else {
      return 0;
    }
  } else {
    if (widget.subMenuOpenMode == SubMenuOpenMode.basic &&
        widget.menuOpenMode == MenuOpenMode.basic &&
        widget.submenu != null) {
      return actualSubMenuRight - getActualSubMenuWidth() - getBodyWidth();
    } else if (widget.menuOpenMode == MenuOpenMode.basic) {
      return getMenuX() - getBodyWidth();
    } else if (widget.menuCloseMode == MenuCloseMode.narrow) {
      return 0;
    } else {
      return 0;
    }
  }
}