【问题标题】:Child container of AlertDialog not covering widthAlertDialog 的子容器不覆盖宽度
【发布时间】:2019-12-04 16:11:32
【问题描述】:

我想在点击按钮时显示一个弹出窗口。当我尝试使用此 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'),
            )
          ],
        ),
      ),
    )

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

【问题讨论】:

    标签: user-interface flutter dart flutter-layout


    【解决方案1】:

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

    contentPadding: EdgeInsets.all(0.0),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-08
      • 2018-11-23
      • 2016-01-12
      相关资源
      最近更新 更多