如何在Flutter中创建自定义弹出菜单

时间:2019-11-01 06:59:47

标签: flutter flutter-layout flutter-dependencies flutter-animation

您好,我是新手,如下面的屏幕快照所示,如何实现自定义PopUpMenu

ScreenShot

任何帮助将不胜感激,谢谢。

1 个答案:

答案 0 :(得分:0)

您应使用 showDialog 方法显示 AlertDialog 小部件。

showDialog(
    context: context,
    builder: (BuildContext context) {
        return AlertDialog(
            title: Text("PopUp title"),
            content: Text("PopUp content text"),
            actions: <Widget>[
                FlatButton(child: Text("Close"), onPressed: () => Navigator.pop(context))
            ],
          );
        });