黑屏,中间有圆圈

问题描述 投票:0回答:1

[嗨,我正在尝试创建一个除了中间的圆圈之外的全黑屏幕。我写了一些创建黑屏的代码:

       Stack(
         ...
          Positioned.fill(
                child: Container(
                       color: Colors.grey.withOpacity(0.5),
               )
          )
     )

但是我面临的问题是,我不知道如何在屏幕上打一个圆孔,以致无法显示出堆栈中背后的内容。

提前感谢您的回答!

flutter dart styling
1个回答
0
投票

这应该为您工作。

 Container(
                color: Colors.black,
                alignment: Alignment.center,
                child: new SizedBox(
                    child: FloatingActionButton(
                  backgroundColor: Colors.white,
                  child: null,
                  onPressed: () {
                    print("Cliked");
                  },
                ))));
© www.soinside.com 2019 - 2024. All rights reserved.