为什么PopupMenuButton下拉菜单与statusBar重叠?

时间:2018-07-07 17:54:11

标签: flutter popupmenubutton

当我为PopupMenuButton设置initialValue时,下拉菜单与状态栏重叠。如何避免这种情况?另外,如何使PopupMenuButton在appbar下方的下拉位置?

enter image description here

1 个答案:

答案 0 :(得分:-1)

您可以尝试以下步骤:

  Widget getMessageText(double parentHeight, double parentWidth) {
    return Padding(
      padding:  EdgeInsets.only(right:parentWidth*0.06),
      child: Column(
        children: <Widget>[
          GestureDetector(
            onTap: (){
              Navigator.pop(context);

            },
            child: Padding(
              padding:  EdgeInsets.only(top: parentHeight*0.02,left: parentWidth*.03),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  new Text(
                    "All Posts",
                    style: CommonWidget.getHelveticaBoldTextStyle(
                        textFont, Colors.black.withOpacity(0.7)),
                    textScaleFactor: 1.1,
                  //  textAlign: TextAlign.center,
                  ),
                ],
              ),
            ),
          ),
          GestureDetector(
            onTap: (){
              Navigator.pop(context);


            },
            child: Padding(
              padding:  EdgeInsets.only(top: parentHeight*0.03,left: parentWidth*.03),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Text(
                    "Posts",
                    style: CommonWidget.getHelveticaBoldTextStyle(
                        textFont, Colors.black.withOpacity(0.7)),
                    textScaleFactor: 1.1,
                    //  textAlign: TextAlign.center,
                  ),
                ],
              ),
            ),
          ),
          GestureDetector(
            onTap: (){

              Navigator.pop(context);

            },
            child: Padding(
              padding:  EdgeInsets.only(top: parentHeight*0.03,left: parentWidth*.03),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Text(
                    "Complaints",
                    style: CommonWidget.getHelveticaBoldTextStyle(
                        textFont, Colors.black.withOpacity(0.7)),
                    textScaleFactor: 1.1,
                    //  textAlign: TextAlign.center,
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );



  }