颤振如何使这种样式的小部件?

时间:2020-08-28 02:35:51

标签: flutter flutter-dependencies

单击appBar的操作以在下面展开一个弹出窗口,然后再次单击“操作”以缩小弹出窗口。或者是否有具有这种效果的插件推荐?

enter image description here

1 个答案:

答案 0 :(得分:0)

如果您的视图是简单视图,则可以使用简单弹出窗口,请参见this教程。

如果您的视图比较复杂,则必须对其进行自定义。您需要同时创建菜单Widget和容器,并展开部分,自定义显示如主页。然后将其显示为对话框。

showGeneralDialog(
  context: context,
  barrierColor: Colors.black12.withOpacity(0.6), // background color
  barrierDismissible: false, // should dialog be dismissed when tapped outside
  barrierLabel: "Dialog", // label for barrier
  transitionDuration: Duration(milliseconds: 400), // how long it takes to popup dialog after button click
  pageBuilder: (_, __, ___) { // your widget implementation
    FocusScope.of(context).requestFocus(_focusNodeCity);
    return SafeArea(
      child: Material(
        color: Colors.transparent,
        child: SizedBox.expand( // makes widget fullscreen
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
          
            ],
          ),
        ),
      ),
    );
  },
);