如何在Flutter中的Card Widget中绘制垂直线和水平线[关闭]

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

如何在 Flutter 中画这条线?你有什么建议吗?

flutter dart draw
2个回答
1
投票

尝试下面的代码希望对您有帮助。

   Card(
            child: Column(
              children: [
                Container(
                  height: 200,
                  child: Center(
                    child: Text(
                      'Your other Widget',
                    ),
                  ),
                ),
                Container(
                  color: Colors.black,
                  height: 1,
                  width: double.infinity,
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: [
                    Text(
                      'Your Widget',
                    ),
                    Container(
                      color: Colors.black,
                      height: 50,
                      width: 1,
                    ),
                    Text(
                      'Your Widget',
                    ),
                  ],
                ),
              ],
            ),
          ),

您的结果屏幕->


0
投票

很简单,使用

Divider
VerticalDivider

Column(children: [
  Divider(),
  Row(
      children: [
        Widget()...,
        VerticalDivider(),
        Widget()...
      ]
    )
])
© www.soinside.com 2019 - 2024. All rights reserved.