简体   繁体   English

Flutter:如何创建全屏蒙版视图

[英]Flutter:How to create a full screen mask view

Now I'm using the showModalBottomSheet, 现在,我正在使用showModalBottomSheet,

when I click on the semi-transparent bottomsheet, it pops this view out, but what I want is that it doesn't respond to the user's click and still stays there, how do I do that? 当我单击半透明的底表时,它将弹出该视图,但是我想要的是它不响应用户的点击并仍然停留在该位置,我该怎么做?

How to create a full screen mask view? 如何创建全屏蒙版视图?

在此处输入图片说明

If user click on - semi-transparent area - ModalBottomSheet won't close using - WillPopScope 如果用户单击-半透明区域ModalBottomSheet将无法使用WillPopScope

showModalBottomSheet(
              context: context,
              builder: (context) {
                return WillPopScope(  // add this
                    onWillPop: () async => false,
                    child: Container()); // your code continues
              });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM