Flutter develop custom pop-up box --------

Foreword

Now flutter Exit button to pop-up box is fixed in one place. The project needs to click on a random exit. So to our custom pop-up box

Examples of code analysis

Future myDialog(context){
  return showDialog<Null>(
        context: context,
        barrierDismissible: false,
        builder: (BuildContext context) {
            return GestureDetector(							// 手势处理事件
              

              onTap: (){
                Navigator.of(context).pop();				//退出弹出框
              },


              child: Container(								//弹出框的具体事件
                child: Material(
                  color: Color.fromRGBO(0, 0, 0, 0.5),
                  child: Center(
                    child: Text('具体操作',style: prefix0.TextStyle(color: Colors.white),),
                  ),
                ),
              )
            );
            
        },
    );
}

This is the day I met needs, see the online written mess, so here writing a relatively simple, with just a suggestion of white flutter developed

Published 50 original articles · won praise 35 · views 40000 +

Guess you like

Origin blog.csdn.net/qq_35905501/article/details/95199279