AlertDialog的子容器未覆盖宽度

时间:2019-07-26 10:16:19

标签: user-interface flutter dart flutter-layout

我想在按钮点击时显示一个弹出窗口。当我尝试显示带有自定义设计子级的AlertDialog时,此AlertDialog的容器未覆盖整个空间。它从角落有一些填充。 我以这种方式实现了:

AlertDialog(
      shape: OutlineInputBorder(
        borderRadius: BorderRadius.circular(16.0)
      ),
      content: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Container(
              color: Colors.redAccent,
              width: screenSize.width,
              height: screenSize.height*.90,
              child: Text('test'),
            )
          ],
        ),
      ),
    )

有关更多信息,我正在添加屏幕截图。 enter image description here

1 个答案:

答案 0 :(得分:1)

我找到了解决方案。我通过在AlertDialog中添加以下标记来解决此问题:

contentPadding: EdgeInsets.all(0.0),
相关问题